if((Open[0]>=Open[1])) { GetNextBuy(); CompleteBuy(); } ======================================================================= void GetNextBuy() { RefreshRates(); Lots = AutoLotSize(); result=OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,0,0,"BFG EA",MagicNumber,0,Blue); // // If there was an error, log it. // if(result < 0)Print("ERROR - Unable to access the order - ", OrderTicket(), " - ", GetLastError()); // If there was an error, log it. if (result < 0) Print("ERROR - Unable to access order - ", ticket, " - ", GetLastError()); // } ======================================================================= void CompleteBuy() { if(result>=0) { TheStopLoss=0; TheTakeProfit=0; if(TakeProfit>0) TheTakeProfit=Ask-TakeProfit*MyPoint; if(StopLoss>0) TheStopLoss=Ask+StopLoss*MyPoint; OrderSelect(result,SELECT_BY_TICKET); OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(TheStopLoss,Digits),NormalizeDouble(TheTakeProfit,Digits),0,Green); } return; }