Help in Break Even

[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);
   }    
   }
 }

I bought the book “expert advisor programming for metatrader 5 - Andrew R young”

Itll teach you all the basics of MT5 MetaEditor.

I just use their template to make EAs, It includes break even, trailing stop, ordersend etc…

finished coding my first program yesterday :slight_smile:

Thnx Guys EA Done!! :slight_smile:

What does the EA do if you dont mind me asking?
Always interested in others ideas:)