//+------------------------------------------------------------------+ //| test.mq4 | //| | //| | //+------------------------------------------------------------------+ #property copyright "" #property link "" #property version "1.00" #property strict int listOfStopMNumbers[][2]; int listOfLiveMNumbers[][2]; //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { //--- } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { ArrayResize(listOfLiveMNumbers,10,4); ArrayResize(listOfStopMNumbers,10,4); int resNums[][2]; ArrayResize(resNums,0); Print("listOfLiveMNumbers"); ArrayPrintInt(listOfLiveMNumbers); Print("listOfStopMNumbers"); ArrayPrintInt(listOfStopMNumbers); ArrayMerge(listOfStopMNumbers, listOfLiveMNumbers, resNums); } //+------------------------------------------------------------------+ int ArrayMerge(int &stopArray[][], int &liveArray[][], int &resultArray[][]) { bool isfound=false; int i=0,j=0,as=0; if(ArraySize(liveArray)==0 || ArraySize(stopArray)==0) { Print("ArrayMerge: both arrays must have values"); Print("liveArray"); ArrayPrintInt(liveArray); Print("stopArray"); ArrayPrintInt(stopArray); return(-1); } ArrayCopy(resultArray,stopArray); for(i=0;i do nothing, else live order has more power resultArray[j,1] = liveArray[i,1]; } } return 1; } //////////////////////////////////////////////////////////////////// bool ArrayPrintInt(int &array[][]) { Print("Array Size (ArrayPrintInt):", ArraySize(array)); int size=ArraySize(array)/2; string message="Array ("; for (int a=0; a