Hello Coders. I need help below. I'm trying to amend my EA but getting errors as titled above.
"
void Trail()
{
for(int i=Orders()-1;i>=0;i--)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
{
if(OrderMagicNumber()==Magicpo && OrderType()==OP_BUY)
{
if(Bid-OrderOpenPrice()>StartTrailingAt*Point && UseTrailingStop==true)
{
if(OrderStopLoss()<Bid-TrailingStep*Point || OrderStopLoss() == 0)
{
//--- modify order and exit
if(!OrderModify(OrderTicket(),OrderOpenPrice(),Bid-TrailingStep*Point,OrderTakeProfit(),0,clrYellow))
Print("OrderModify error ",GetLastError());
return;
}
}
}
if(OrderType() == OP_SELL && OrderSymbol() == Symbol() && UseTrailingStop==true)
{
if((OrderOpenPrice()-Ask)>(StartTrailingAt*Point))
{
if(OrderStopLoss()>Ask+TrailingStep*Point || OrderStopLoss() == 0 && (OrderMagicNumber() == magic || OrderMagicNumber()== magics))
{
//--- modify order and exit
if(!OrderModify(OrderTicket(),OrderOpenPrice(),Ask+TrailingStep+Point,OrderTakeProfit(),0,clrYellow))
Print("OrderModify error ",GetLastError());
}
}
}
}
}
"
"
void Trail()
{
for(int i=Orders()-1;i>=0;i--)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
{
if(OrderMagicNumber()==Magicpo && OrderType()==OP_BUY)
{
if(Bid-OrderOpenPrice()>StartTrailingAt*Point && UseTrailingStop==true)
{
if(OrderStopLoss()<Bid-TrailingStep*Point || OrderStopLoss() == 0)
{
//--- modify order and exit
if(!OrderModify(OrderTicket(),OrderOpenPrice(),Bid-TrailingStep*Point,OrderTakeProfit(),0,clrYellow))
Print("OrderModify error ",GetLastError());
return;
}
}
}
if(OrderType() == OP_SELL && OrderSymbol() == Symbol() && UseTrailingStop==true)
{
if((OrderOpenPrice()-Ask)>(StartTrailingAt*Point))
{
if(OrderStopLoss()>Ask+TrailingStep*Point || OrderStopLoss() == 0 && (OrderMagicNumber() == magic || OrderMagicNumber()== magics))
{
//--- modify order and exit
if(!OrderModify(OrderTicket(),OrderOpenPrice(),Ask+TrailingStep+Point,OrderTakeProfit(),0,clrYellow))
Print("OrderModify error ",GetLastError());
}
}
}
}
}
"