link s/l to additional parameters

 

Hello,

 

does anybody know if it is possible to code the stoploss of an EA so that it only is executed if certain other parameters are fulfilled.

To be exact I would like my s/l only be executed if bid and ask move into one direction to avoid stopouts due to an abrupt increase of spread into one direction.

 

Thank you

 

Lee 

 
f1b0lut10n:

Hello,

does anybody know if it is possible to code the stoploss of an EA so that it only is executed if certain other parameters are fulfilled.

To be exact I would like my s/l only be executed if bid and ask move into one direction to avoid stopouts due to an abrupt increase of spread into one direction.

Thank you

Lee 

Hello Lee (f1b0lut10n),

A stop loss is something "rigid"... once it's placed and price "touches" the SL level, it's always executed. So, either you develop a "logic" for placing the SL at the righ place, or you develop any other logic that "changes" SL (a trailing stop?) level while a set of other paremeters is fulfilled.

Anyway, it's perfectly possible to do that. Although it's not clear (at least for me) how, exactly, you want to implement this logic, everything you described can be accessed using MQL5.

Regards,
Malacarne

Reason: