backtesting.py icon indicating copy to clipboard operation
backtesting.py copied to clipboard

Chart Rendering seems incorrect

Open firstprayer opened this issue 1 month ago • 1 comments

Expected behavior

When I am testing my strategy, I noticed the strategy was placing order at odd places on the charts. On the closer inspection, I think the OHLC rendering on the chart is incorrect

If you checked the time 10/17 21:05 PM

Correct data: Close = 1072.25 Image

I expect to see the same data on chart.

Code sample


Actual behavior

Incorrect data rendered on chart: Close = 1071.192

Image

Any idea on why this is happening? Is it due to some misalignment issue?

Additional info, steps to reproduce, full crash traceback, screenshots

No response

Software versions

  • backtesting.__version__: 0.6.5
  • pandas.__version__: 2.3.2
  • numpy.__version__: 2.2.6
  • bokeh.__version__: 3.8.0
  • OS: MacOS

firstprayer avatar Oct 26 '25 06:10 firstprayer

Could be https://github.com/kernc/backtesting.py/issues/1002, but your data and the chart say UTC. 🤷

This is strange. I don't think plotting should change OHLC values. 🤔 Assuming it's indeed some offset issue, have you managed to trace the pointed to line to the corresponding line in your data?

kernc avatar Oct 31 '25 01:10 kernc