Download MetaTrader 5

Adding pips to a trailing stop.

To add comments, please log in or register
ForexTrader17
1041
ForexTrader17  

I am trying to add/subtract pips to a trailing stop code depending on buy/sell. Is this correct?

if(isNewBar) TrailingStopSet(OP_BUY, Support(4 * PeriodSeconds(), false, 00, 00, true, 1)) - 5 * myPoint

if(isNewBar) TrailingStopSet(OP_BUY, Support(4 * PeriodSeconds(), false, 00, 00, true, 1)) + 10 * myPoint 

 Is this correct or move it into the parenthesis?

Thanks. 

Marco vd Heijden
Moderator
4752
Marco vd Heijden  
ForexTrader17:

I am trying to add/subtract pips to a trailing stop code depending on buy/sell. Is this correct?

if(isNewBar) TrailingStopSet(OP_BUY, Support(4 * PeriodSeconds(), false, 00, 00, true, 1)) - 5 * myPoint

if(isNewBar) TrailingStopSet(OP_BUY, Support(4 * PeriodSeconds(), false, 00, 00, true, 1)) + 10 * myPoint 

 Is this correct or move it into the parenthesis?

Thanks. 

I do not understand what you are trying to do.

There is not enough code.

Alain Verleyen
Moderator
31184
Alain Verleyen  
ForexTrader17:

I am trying to add/subtract pips to a trailing stop code depending on buy/sell. Is this correct?

if(isNewBar) TrailingStopSet(OP_BUY, Support(4 * PeriodSeconds(), false, 00, 00, true, 1)) - 5 * myPoint

if(isNewBar) TrailingStopSet(OP_BUY, Support(4 * PeriodSeconds(), false, 00, 00, true, 1)) + 10 * myPoint 

 Is this correct or move it into the parenthesis?

Thanks. 

Of course.
ForexTrader17
1041
ForexTrader17  
Alain Verleyen:
Of course.

Thank you. Is this correct?

if(isNewBar) TrailingStopSet(OP_BUY, Support(4 * PeriodSeconds(), false0000true1)) - (5 * myPoint)

if(isNewBar) TrailingStopSet(OP_BUY, Support(4 * PeriodSeconds(), false0000true1)) + (10 * myPoint)

To add comments, please log in or register