Trailing Stop Problem..........

 

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

 
babarmughal:
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

Try to change that:

OrderType()<=OP_SELL

to this:

OrderType()!=OP_SELL

 
Kalenzo:
Try to change that:

OrderType()<=OP_SELL

to this:

OrderType()!=OP_SELL

HI ,

It's still not working..........please help anyone...