Max and miniumum stop loss / take profit
-
How can i set a max and/or minimum value in pips for stop loss or take profit. For example i set the stop loss for a sell trade above the high of last 5 candles. At entry the swing high is 50 pips away, but i want to set stop loss at least 60 pips away. Or swing high is 50 pips away but i want to set a stop loss at max 40 pips away.
The max and minimum values would override the condition that sets the stop loss placement..
same goes for take profits.
Thankjs
-
@piptheripper Not completely sure what you mean. Can you please upload an image?
-
Thanks, appreciate it. I tried making an image to explain. Dont know if that is clear? Read through 1-4 to follow the logic.

-
@piptheripper So If I undertand it correctly, you need the EA to compare two distances: 20 pips or the lowest price of the previous 5 candles. Whichever is lower will be applied and in no case it will exceed 20 pips. Is that correct?
-
Almost.. the stop loss for a buy order in this strategy is placed at the low of the last 5 candles. However, if the low of the last five candles exceeds 20 pips (the max stop loss) then the ea places the stop loss 20 pips away. So yes, the stop loss never exceeeds 20 pips, no matter how far away the default stop loss level(below/above 5 last candles) is.
The same goes for minimum stop loss level. If the low of the last five candles is 10 pips away, but i set minimum stop loss to 15 pips, then the stop loss will be placed at 15 pips from entry price.
another example would be a stop loss based on atr. If atr is 60 at entry price, but i set max stop loss to 40, then stop loss is placed 40 pips away.
So in other words the max and minimum stop loss overrides the default stop loss rules. The stop loss will never exceed the max stop loss pip value, and will never be smaller then the minimum stop loss pip value.
Hope its clear.
THANKS!!
-
@piptheripper Then you are requesting for a fixed stop loss. Right? You can select it here:

-
The idea is to not use fixed stop loss per default, but place the stop loss based on swing highs or swing lows per default..
But sometimes one of the previous five candles will be massive. Lets say its 200 pips due to some news release or something.
In this case, to protect against setting a large stop loss i would use the max stop loss value.
The same goes for minimum stop loss. In some cases the low of the last five candles is only 5 pips away. And again, to protect against setting way to small stop loss, the minimum stop loss value overrides the dafault stop loss.
Its a protective mechanism to not place stop losses that are too wide or too narrow. Most of the time the ea will simply set the stop loss below or above the swing lows/highs (last five candles) but in those instances where the distance to the swing high or low is either way too large or way too small, the max and minimum stop loss values overrides the default stop loss settings..
If its too complicated we can go over it together when we meet on skype for the course class..
Cheers
-
i found a way to do it, if anyone else looks for the same type of max/min stop loss values, you can and example of how the max stop loss works. https://fxdreema.com/shared/2iS0KTZwc
-
@piptheripper Good for you! Thank you for sharing.
-
@PipTheRipper thanks a lot! I was looking for this
-
@PipTheRipper I have been trying to something similar. Can you please share your FxDreema blocks?