babarmughal:
Hi Guys,
Hi Guys,
I have got this code and i am having problem on Trailing Stop. Its not EA is not activating TS...Please help
Here is the code....
if(TrailingStop>0 && subTotalTrade()>0){
total = OrdersTotal();
for(cnt=0;cnt<total;cnt++)
{
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
if(OrderType()<=OP_SELL &&
OrderSymbol()==Symbol() &&
OrderMagicNumber()==MagicNumber)
{
subTrailingStop(OrderType());
return(0);
}
}
}
return(0);
}
Thanks
BabarTry to change that:
OrderType()<=OP_SELL
to this:
OrderType()!=OP_SELL
Kalenzo:
Try to change that:
Try to change that:
OrderType()<=OP_SELL
to this:
OrderType()!=OP_SELLHI ,
It's still not working..........please help anyone...

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi Guys,
I have got this code and i am having problem on Trailing Stop. Its not EA is not activating TS...Please help
Here is the code....
if(TrailingStop>0 && subTotalTrade()>0){
total = OrdersTotal();
for(cnt=0;cnt<total;cnt++)
{
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
if(OrderType()<=OP_SELL &&
OrderSymbol()==Symbol() &&
OrderMagicNumber()==MagicNumber)
{
subTrailingStop(OrderType());
return(0);
}
}
}
return(0);
}
Thanks
Babar