Download MetaTrader 5

Stop Loss Help

To add comments, please log in or register
John Walters
249
John Walters  

Need some help on how to code stop loss on the next order to open.

Exmaple:

Order 1 = Opens with StopLoss of 200 points.

Order 2 = Opens next signal with StopLoss of 10 points below/above Last Open Order StopLoss  (Order 1 is still open)

Order 3 = Opens next signal with StopLoss of 10 points below/above Last Open Order StopLoss (Order 1 and 2 are still open)

If no orders are open it will use the default SL of 200 for example.


Another Example:

Order 1 Sell SL: 1.5200

Order 2 Sell SL: 1.5210

Order 3 Sell SL: 1.5220


If someone can give me guidance that would great!

Keith Watford
Moderator
10611
Keith Watford  

Depending on the way the EA operates, you could simply find the stoploss of the most recent open order with the same magic number and ordertype.

Set the new order's stoploss 10 pips above/below it. 

To add comments, please log in or register