Download MetaTrader 5
To add comments, please log in or register
Publish your application in Cobe Base. Millions of traders will see it!
John Walters
128
John Walters 2015.02.11 06:00 

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
7985
Keith Watford 2015.02.11 06:26  

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