Disliked{quote} Thank you for your Help Best! It now takes entry as should but still immediately after the close at tp it reopens the same position with same sl but huge tp because of the distance to sl ofcourse {image}Ignored
I tested it, and it now stops trading when the first Position for the reference bar is closed by TP.
Also it stops when 2 Deals have been closed for the reference bar.
About the [Invalid stops] error - this issue may persist if you don't specify how you want to manage such cases.
Your condition for Entry is: "Close of Bar[1] < Low of reference bar = Sell or Close of Bar[1] > High of reference bar, and there is no trade floating for this reference bar" -> this means, for example, that you may have had a Sell Position closed by SL but Bar[1] is still Close below Low of reference bar, so the EA will attempt another Sell, and the price will still go up... The way the EA is working now, it should adjust the SL to the stop distance +/- your input offset. And, of course, there may be cases when the SL distance will be very big, so the TP distance will be even bigger.
What I changed, except for the proper detection of TP and number of closed Deals, is the Ratio is now double, so you can do 0.5 instead of 2. Also, I did a double tier check if TP.
Test it out!
Attached File(s)
Also, I noticed the mistake in the name!!! Strom vs Storm
.ex4/.ex5 files can't be fixed or modified / I'm not a coder!