For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
Resampled candles is different than on chart
I can't understand why when I use resampled data, the plot shows differrent candles than on the chart (TradingView).
Here is the screenshot below (the top row is not resampled 1m data, the bottom is resampled with compression=60)
cerebro.resampledata(data, timeframe=bt.TimeFrame.Minutes, compression=60) ... # Plot the result cerebro.plot(style='candle')
Here is csv data I used: data.csv
On 2020-06-09 00:15:00 price hits 9876 (highest price on the chart)
On TradingView it shows at "00:00" candle, but on the plot from BackTrader it shows only at "01:00" candle.
It was compared with the 1h data from https://en.tradingview.com/chart/?symbol=BITFINEX%3ABTCUSD for 09 Jun 2020.
I solved this by adding
I solved this by adding "boundoff=1"
cerebro.resampledata(data, timeframe=bt.TimeFrame.Minutes, compression=60, boundoff=1)
Now is shows exactly as on TW platform.