for(cnt=0;cnt<total;cnt++) { //set trailing stop if (OrderType() == OP_BUYNo OrderSelect. Always count down.
for(int iPos = OrdersTotal()-1; iPos >= 0 ; iPos--) if ( OrderSelect(iPos, SELECT_BY_POS) // Only my orders w/ && OrderMagicNumber() == magic.number // my magic number && OrderSymbol() == symbolChart // and my pair. ){
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 all guru here,
If not mistaken, trailing stop will move your stoploss in one direction, either up or down closer to market value
Using the code above, I found that the stoploss will move up and down.
Example, for BUY, when the market value is more than the trailing stop, the stoploss will be adjusted to higher value. When the market value fall, the stoploss by right will remain there.
But I notice the stoploss will move up and down accordingly to the market price