Help Needed with Adding Stop Loss Condition to EA
-
Hi,
I need help modifying my EA that uses pending orders. The EA dynamically calculates stop loss based on recent highs/lows, ranging from 2 to 50 pips.
I want to:
Prevent placing orders with a stop loss below 22 pips.
Alternatively, delete orders that have been placed with a stop loss below 22 pips, per tick to avoid market entry in case of fast market events.
Any assistance is appreciated!
Thanks,
-
-
-
Well, I have no idea how your SL distances are calculated in the first place. Could you please share the link to your project?
-
Hi, Andorrà,
I use custom price levels to calculate the SL, and then determine the price of the Stop Loss based on the candle ID high or low.
Here is the link to the project:
-
@lele13061991 said in Help Needed with Adding Stop Loss Condition to EA:
Hi, Andorrà,
I use custom price levels to calculate the SL, and then determine the price of the Stop Loss based on the candle ID high or low.
Here is the link to the project:
-
Then you can connect this structure below both 'buy/sell pending orders.
https://fxdreema.com/shared/xnA2tXNQc
It should delete all pending orders with a SL distance bigger than 22 pips immediately after having created it.