From 8cd2ee95f95ad12c9d078f2b01890af21d3cff07 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 30 Aug 2025 14:56:23 +0200 Subject: [PATCH] feat: add developer documentation to generate backtest results --- docs/developer.md | 12 +++++ tests/testdata/config.tests.json | 1 + tests/testdata/config.tests.usdt.json | 77 +++++++++++++++++++++++++++ 3 files changed, 90 insertions(+) create mode 100644 tests/testdata/config.tests.usdt.json diff --git a/docs/developer.md b/docs/developer.md index b0cf21398..2c36ce4fe 100644 --- a/docs/developer.md +++ b/docs/developer.md @@ -408,6 +408,18 @@ jupyter nbconvert --ClearOutputPreprocessor.enabled=True --inplace freqtrade/tem jupyter nbconvert --ClearOutputPreprocessor.enabled=True --to markdown freqtrade/templates/strategy_analysis_example.ipynb --stdout > docs/strategy_analysis_example.md ``` +## Backtest documentation results + +To generate backtest outputs, please use the following commands: + +``` bash +freqtrade create-userdir --userdir user_data_bttest/ +freqtrade download-data --timerange 20250625-20250801 --config tests/testdata/config.tests.usdt.json --userdir user_data_bttest/ -t 5m + +freqtrade backtesting --config tests/testdata/config.tests.usdt.json -s SampleStrategy --userdir user_data_bttest/ --cache none --timerange 20250701-20250801 +``` + + ## Continuous integration This documents some decisions taken for the CI Pipeline. diff --git a/tests/testdata/config.tests.json b/tests/testdata/config.tests.json index fdfa97350..d57673f91 100644 --- a/tests/testdata/config.tests.json +++ b/tests/testdata/config.tests.json @@ -1,4 +1,5 @@ { + "$schema": "https://schema.freqtrade.io/schema.json", "max_open_trades": 3, "stake_currency": "BTC", "stake_amount": 0.05, diff --git a/tests/testdata/config.tests.usdt.json b/tests/testdata/config.tests.usdt.json new file mode 100644 index 000000000..344793d48 --- /dev/null +++ b/tests/testdata/config.tests.usdt.json @@ -0,0 +1,77 @@ +{ + "$schema": "https://schema.freqtrade.io/schema.json", + "max_open_trades": 3, + "stake_currency": "USDT", + "stake_amount": "unlimited", + "tradable_balance_ratio": 0.99, + "fiat_display_currency": "USD", + "trading_mode": "futures", + "margin_mode": "isolated", + "timeframe": "5m", + "dry_run": true, + "cancel_open_orders_on_exit": false, + "unfilledtimeout": { + "entry": 5, + "exit": 5, + "exit_timeout_count": 0, + "unit": "minutes" + }, + "entry_pricing": { + "price_side": "same", + "use_order_book": true, + "order_book_top": 1, + "price_last_balance": 0.0, + "check_depth_of_market": { + "enabled": false, + "bids_to_ask_delta": 1 + } + }, + "exit_pricing":{ + "price_side": "same", + "use_order_book": true, + "order_book_top": 1 + }, + "exchange": { + "name": "bybit", + "key": "your_exchange_key", + "secret": "your_exchange_secret", + "ccxt_config": {}, + "ccxt_async_config": {}, + "pair_whitelist": [ + "BTC/USDT:USDT", + "ETH/USDT:USDT", + "LTC/USDT:USDT", + "ETC/USDT:USDT", + "XLM/USDT:USDT", + "XRP/USDT:USDT", + "ADA/USDT:USDT", + "DOT/USDT:USDT" + ], + "pair_blacklist": [ + ] + }, + "pairlists": [ + {"method": "StaticPairList"} + ], + "telegram": { + "enabled": false, + "token": "your_telegram_token", + "chat_id": "your_telegram_chat_id" + }, + "api_server": { + "enabled": false, + "listen_ip_address": "127.0.0.1", + "listen_port": 8080, + "verbosity": "error", + "jwt_secret_key": "somethingrandom", + "CORS_origins": [], + "username": "freqtrader", + "password": "SuperSecurePassword" + }, + "bot_name": "freqtrade", + "initial_state": "running", + "force_entry_enable": false, + "internals": { + "process_throttle_secs": 5 + } +}