Hi, I’m trying to understand how to set the opening / closing of any position (long, short) when the price reaches for example the bollinger bands or a simple moving average.
The problem is given by the fact that whatever I put, the backtest ALWAYS closes my positions at the close of the candle, if I put “close position if it is> or = for example at the 20-period moving average, this waits for the first candle that actually CLOSES above that moving average, and maybe the other 5 candles before had far exceeded the above moving average with spikes, but then they had simply closed below and therefore kept the position open for me .. and same thing with the bollinger bands, I can put close if it crosses bullish, if it is greater than or equal to the upper band, but we always talk about closing the bar! doing so many strategies don’t work because the price is given by all its fluctuations in that candle, and not only by the opening and closing.
I hope I have explained my need well and I hope it is possible to give this command, possibly from the “simplified” commands, otherwise also from the command lines if it were the only possibility.
Thank you in advance