Stop loss below the lowest of the last 5 candles
Forums › ProRealTime English forum › ProOrder support › Stop loss below the lowest of the last 5 candles
- This topic has 13 replies, 4 voices, and was last updated 2 years ago by JS.
-
-
04/10/2022 at 6:49 PM #191533
Hello,
How do you place your stop loss below the lowest of the last 5 candles (at the time of entry)?
I tried with :
1sl= (close < lowest[5])but this piece of code gives random stops because many times the price closed below the last 5 lows without the trade being closed (as you can see in the screenshot)
And most importantly, I don’t want to have a trailing stop, I want to use a fixed stop loss, which is below the last 5 lows AT THE TIME OF BUY.
How do I code this type of stop ?
Thank you for your help 🙂04/10/2022 at 7:31 PM #191537deleted
(sorry, I misread your post, my reply would not have been relevant)
04/10/2022 at 8:14 PM #19154104/11/2022 at 11:35 AM #19156104/11/2022 at 11:55 AM #191563Thank you for your answer.
As you can see in the 1st screenshot, it seems that we can’t use the code lines with the final “LOW”.As you can see in the 2nd screenshot, when we remove the low, it does not close the trade at the last 5 lows at the time of entry.
04/11/2022 at 12:00 PM #191566we can’t use the code lines with the final “LOW”.
JS got it right below! 🙂
Also … did JS fixed SL work?
04/11/2022 at 12:01 PM #19156704/11/2022 at 12:04 PM #191568Hi JS,
Thank you for your answer.
As you can see in the screenshot, it looks like close the trade at if the close is below the current 5 candlestick low.However as you can see in the screenshot, it does not close the trade at the level of the last 5 lows at the time of entry (extension of the blue line) :
04/11/2022 at 12:08 PM #191571Indeed, the brackets allow to use (Low).
However, this does not generate a fixed sl but a tracking sl.
I think we are close to the solution 🙂1 user thanked author for this post.
04/11/2022 at 12:15 PM #191574Hoi Olivier,
The idea of a fixed StopLoss is:
For example:
You buy at 100
Your fixed StopLoss is 10
Then only when the Close crosses under 90 (100 – 10) your position will be closed.
What you are showing in your screenshots is a trailing stop and not a fixed StopLoss.
04/11/2022 at 12:29 PM #19157504/11/2022 at 1:50 PM #191580In the different screenshots I have shown you the results of the different codes received which generate trailing stops and not fixed stops.
Sorry if it was not clear and you are right to point it out, you should not take into account the bottom of the Donchian Channel of 5 periods over the entire duration of the trade.
Its display shows the extension of the level at which it is located when the trade is triggered.You will find in the last screenshot what is expected as a fixed stop with the dotted extension of the blue line. These dotted lines correspond to the low of the last 5 candles at the time the trade is triggered.
04/11/2022 at 1:52 PM #191581Hi JS,
Unfortunately, even if you remove “If Not LongOnMarket …”, the code still generates errors.
For example in the screenshot below:
the 1st trade should close at the same level as the 2nd trade.
The 2nd trade should close earlier04/11/2022 at 3:43 PM #191587Hi Olivier,
Don’t remove “If Not LongOnMarket…” from the code, otherwise your SL will be recalculated with every new bar…
In the bar, where your Buy condition is true, the SL will be calculated according to “Close – Lowest[5](Low)”, then your SL is a fixed number.
In the next bar, your buy order is executed on the Open of that bar. Your order price (TradePrice) is the Open of that bar.
Your actual SL is now: TradePrice – SL
Hope it is clear…(not easy to explain) 😉
-
AuthorPosts
Find exclusive trading pro-tools on