trouble is detected, in real trading, deals open and disappear on a signal candle. Recommendation: open a deal after closing the signal candle, if the signal is on the closed candle. those. we have not a pleasant delay.
@kirillkiselev82, Signals cannot be verified whilst the candle is open, only closed candles have verified signals. In real trading I recommend only taking deals on candle close, however, this script was only meant for Backtesting setup ideas.
I would love to write an analyst on the system, because I really like it. I ask to eliminate a defect with recalculation of profit and losses, and also to make separate settings for short and long, with possibility of switching off.