Hey Backtrader team, has anyone used an indicator in realtime? I have an issue where I'm using an indicator and want to get the current indicator value, [0] will give me the last closed bar indicator value but while live a new candle is building, I want the current indicator value while the candle is building. Was wondering if anyone has solved this issue before.
Code :
#self.datas[2] is on a 5 second timeframe while self.keltner[3] is on a 5 minute timeframe
#self.keltner[3].bot[0] is the last close candle value but I want the current value while the new candle is building live.
if ((i == 2 and self.datas[2].close[0] < self.keltner[3].bot[0]))
Here's an example, it used the last value not the current (see the blue dot)