Live Trading with updated csv file
I tested a strategy and now I want to try it with live data.
To do this, I coded a method, it gets every 5 minutes, new bar data and writes it to a data.csv file that used for data feed of the strategy.
I reexecute the backtrader strategy including the last inserted data. The strategy logs its buy/sell positions to a log file. Everything goes smooth, but I realised that, backtrader strategy does not working as an event based mode, I mean when the 100th data bar inserted and reexecuted (stopped and rerun the strategy) if moving average indicates a buy signal it would logged.
But I realised that not for the 100th bar the position opened, for example at the 140th bar, the position opened for the 100th bar. Something like repainting happens.
I assumed that I can use any strategy, by appending new bar data to the csv file and rerun strategy for signal output. I am confused, is this approach wrong?