Implement cli options for backtesting-analysis date filtering

This commit is contained in:
froggleston
2022-11-26 16:58:56 +00:00
parent 391817243c
commit 4790aaaae1
8 changed files with 107 additions and 47 deletions

View File

@@ -100,3 +100,18 @@ freqtrade backtesting-analysis -c <config.json> --analysis-groups 0 2 --enter-re
The indicators have to be present in your strategy's main DataFrame (either for your main
timeframe or for informative timeframes) otherwise they will simply be ignored in the script
output.
### Filtering the trade output by date
To show only trades between dates within your backtested timerange, supply the following option(s) in YYYYMMDD format:
```
--analysis-date-start : Start date to filter output trades, inclusive. e.g. 20220101
--analysis-date-end : End date to filter output trades, exclusive. e.g. 20220131
```
For example, if your backtest timerange was `20220101-20221231` but you only want to output trades in January:
```bash
freqtrade backtesting-analysis -c <config.json> --analysis-date-start 20220101 --analysis-date-end 20220201
```

View File

@@ -722,6 +722,8 @@ usage: freqtrade backtesting-analysis [-h] [-v] [--logfile FILE] [-V]
[--enter-reason-list ENTER_REASON_LIST [ENTER_REASON_LIST ...]]
[--exit-reason-list EXIT_REASON_LIST [EXIT_REASON_LIST ...]]
[--indicator-list INDICATOR_LIST [INDICATOR_LIST ...]]
[--analysis-date-start YYYYMMDD]
[--analysis-date-end YYYYMMDD]
optional arguments:
-h, --help show this help message and exit
@@ -744,6 +746,12 @@ optional arguments:
--indicator-list INDICATOR_LIST [INDICATOR_LIST ...]
Comma separated list of indicators to analyse. e.g.
'close,rsi,bb_lowerband,profit_abs'
--analysis-date-start YYYYMMDD
Start date to filter trades for analysis (inclusive). e.g.
20220101
--analysis-date-end YYYYMMDD
End date to filter trades for analysis (exclusive). e.g.
20220131
Common arguments:
-v, --verbose Verbose mode (-vv for more, -vvv to get all messages).