[B]Hello Again dear Traders :)[/B] :
I need to make Break Even for 2 orders with the same symbol simultaneously
I get error 130 and error 1
Any Ideas?
Here is the code :
void Break_Even()
{
{
if(OpenOrdersThisPair(Symbol())==2)
if(OrderSelect(0,SELECT_BY_POS,MODE_TRADES))
if(OrderMagicNumber()==MagicNumber)
if(OrderSymbol()==Symbol())
if(OrderType()==OP_BUY)
if(Ask-OrderOpenPrice() >= NormalizeDouble(BreakEvenPercent*(OrderTakeProfit()-OrderOpenPrice()),Digits))
if(OrderOpenPrice() > OrderStopLoss())
{
modify=OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),0);
}
OpenPrice=OrderOpenPrice();
select=OrderSelect(1,SELECT_BY_POS,MODE_TRADES);
{
modify=OrderModify(OrderTicket(),OrderOpenPrice(),OpenPrice,OrderTakeProfit(),0);
}
}
}