I wrote a script that I should use barstate.islast because of the heavy calculations. But the problem is that I sometimes need also the previous candle too to check if the condition was met there or not. So what should I do? Can say like if ( barstate.islast or barstate.islast[1]).
I tried but I'm not sure if barstate.islast[1] is working or not (because backtesting it in my strategy is so hard and weird and I'm getting confused)