Skip to content

Backtesting Bug / Data mismatch #544

@Gwyneveree

Description

@Gwyneveree

Hi there, very interesting project, but I ran into an issue. After running backtests, I examined the detailed trading logs, manually, each trade one by one, how open_rate and close_rate correlate with open_date and close_date (which they obviously should, using the charts), and there are basically three categories that they fall into:

  1. both open and close rate exactly align with entry and exit candles' open prices
  2. they don't align with specific open or close prices of the candles but fit into the gap between open and close price
  3. neither open nor close rate does not align with the actual price on the chart at all, it's outside the open and close of the candle (or nearby candles), but the strategy registers it as a legitimate trade (usually profitable, but in reality this trade would be losing, especially with leverage)

What can be the issue? I didn't use the repo exactly as it is, just the strategy with a simplified config, but I also adapted the repo config for backtesting just in case, same issue.
Tried using it with one asset, multiple assets, use_order_book true/false, but no matter what there is always at least one trade that falls outside the scope of actual prices, with high leverage it would be fatal.
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions