Closed edesmars closed 5 years ago
I have added your method to the repository. I did not have time to check the code, but will do so in a few days.
Thank you, let me know if you need any help when you are looking into it. ;)
seems to be working fine
Hi,
Thanks for the help on the previous issue. Works perfectly ;) So going through my backtesting, I wanted to use the replay function to backtest a strategy based on 15Min candles using 1Min candles for the ticks.
Though when using the oandav20feed, the data retrieved is already the replay dataframe / compression. In my example, the data fetch was 15Min instead of 1Min. That means that the tick (calling next on strategy) are not using M1 data but M15 so the same as if i don't use replay.
I did a bit of debug and was able to find out that the replay filter will override self._timeframe and self._compression from the data feed. Though in my case a simple override of the replay function in the oandav20feed seems to have fixed the issue with the following code:
You can reproduce the issue by using a modified replay sample files as below (fetch day data to use on a strategy for weeks):
Warning: With the fix proposed, on my system, the values don't correspond between oanda data and replaying the data. I believe it must be some timezone issues between the data coming back from Oanda and the timing of replayed data. But it could simply be another issue on replaying.