Trailing Stop Problem..........
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...
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