Is there a way to backtest with the historical data on trades downloaded with:
freqtrade download-data --days 1 --dl-trades --timeframes 1h
How do I access those trades in the strategy?
no it's not, and it wouldn't make sense either way.
the --dl-trades option was introduced mainly to support downloading data for exchanges which have limited OHLCV data history (Kraken, FTX apparently, ...).
It'll then convert the trades-data into ohlcv data of the timeframes you've chosen (1h, in your case).
If you're using an exchange which supports historic ohlcv download (binance, bittrex, ...), then using --dl-trades only consumes a ton of disk space (and time to download) without much gain.
Using the downloaded trades-data in the strategy will not work because it would not be available during dry-run / live runs, so your backtest would be good - but it'd be a result unarchivable during when starting to forward-test (dry-run).
Even though exchanges have endpoints to fetch trades data, they don't show you the latest trades (for binance the offset is ~500) - so you'd be basing your trade decision on top of 500 trades old data - which will, depending on the pair, be seconds, or even minutes or hours ago.
This delay is also something which wouldn't be simulated in backtesting, which therefore again would cause your strategy to look good on paper (backtesting), but be bad when running it in real market conditions.
@xmatthias Makes sense 100%. Thank you so much for such a extensive answer and super quick reply!!
I really appreciate it.
Merry Christmas.
Most helpful comment
no it's not, and it wouldn't make sense either way.
the
--dl-tradesoption was introduced mainly to support downloading data for exchanges which have limited OHLCV data history (Kraken, FTX apparently, ...).It'll then convert the trades-data into ohlcv data of the timeframes you've chosen (1h, in your case).
If you're using an exchange which supports historic ohlcv download (binance, bittrex, ...), then using
--dl-tradesonly consumes a ton of disk space (and time to download) without much gain.Using the downloaded trades-data in the strategy will not work because it would not be available during dry-run / live runs, so your backtest would be good - but it'd be a result unarchivable during when starting to forward-test (dry-run).
Even though exchanges have endpoints to fetch trades data, they don't show you the latest trades (for binance the offset is ~500) - so you'd be basing your trade decision on top of 500 trades old data - which will, depending on the pair, be seconds, or even minutes or hours ago.
This delay is also something which wouldn't be simulated in backtesting, which therefore again would cause your strategy to look good on paper (backtesting), but be bad when running it in real market conditions.