Elffuss BraidHub

kikocis/freqtrade public

Merge pull request #4751 from freqtrade/pairs_backtesting

Pairs backtesting
Changesetef9df3a5d72cb96a1fb7577b4e9a6fa10c49b707379a7fad2d80c530437803ed
AuthorMatthias <xmatthias@outlook.com> · 2021-04-17 19:14 +02:00
CommitterGitHub <noreply@github.com> · 2021-04-17 19:14 +02:00
Parents9f4457533170, 6f3905d1b2a4

Browse the files at this changeset

9 files changed

modified docs/backtesting.md +5 −1
@@ -15,7 +15,8 @@
1515 [--data-format-ohlcv {json,jsongz,hdf5}]
1616 [--max-open-trades INT]
1717 [--stake-amount STAKE_AMOUNT] [--fee FLOAT]
18- [--eps] [--dmmp] [--enable-protections]
18+ [-p PAIRS [PAIRS ...]] [--eps] [--dmmp]
19+ [--enable-protections]
1920 [--dry-run-wallet DRY_RUN_WALLET]
2021 [--strategy-list STRATEGY_LIST [STRATEGY_LIST ...]]
2122 [--export EXPORT] [--export-filename PATH]
@@ -37,6 +38,9 @@
3738 setting.
3839 --fee FLOAT Specify fee ratio. Will be applied twice (on trade
3940 entry and exit).
41+ -p PAIRS [PAIRS ...], --pairs PAIRS [PAIRS ...]
42+ Limit command to these pairs. Pairs are space-
43+ separated.
4044 --eps, --enable-position-stacking
4145 Allow buying the same pair multiple times (position
4246 stacking).
modified docs/data-download.md +3 −3
@@ -30,7 +30,7 @@
3030 optional arguments:
3131 -h, --help show this help message and exit
3232 -p PAIRS [PAIRS ...], --pairs PAIRS [PAIRS ...]
33- Show profits for only these pairs. Pairs are space-
33+ Limit command to these pairs. Pairs are space-
3434 separated.
3535 --pairs-file FILE File containing a list of pairs to download.
3636 --days INT Download data for given number of days.
@@ -48,10 +48,10 @@
4848 exchange/pairs/timeframes.
4949 --data-format-ohlcv {json,jsongz,hdf5}
5050 Storage format for downloaded candle (OHLCV) data.
51- (default: `json`).
51+ (default: `None`).
5252 --data-format-trades {json,jsongz,hdf5}
5353 Storage format for downloaded trades data. (default:
54- `jsongz`).
54+ `None`).
5555
5656 Common arguments:
5757 -v, --verbose Verbose mode (-vv for more, -vvv to get all messages).
modified docs/edge.md +9 −1
@@ -215,8 +215,10 @@
215215 usage: freqtrade edge [-h] [-v] [--logfile FILE] [-V] [-c PATH] [-d PATH]
216216 [--userdir PATH] [-s NAME] [--strategy-path PATH]
217217 [-i TIMEFRAME] [--timerange TIMERANGE]
218+ [--data-format-ohlcv {json,jsongz,hdf5}]
218219 [--max-open-trades INT] [--stake-amount STAKE_AMOUNT]
219- [--fee FLOAT] [--stoplosses STOPLOSS_RANGE]
220+ [--fee FLOAT] [-p PAIRS [PAIRS ...]]
221+ [--stoplosses STOPLOSS_RANGE]
220222
221223 optional arguments:
222224 -h, --help show this help message and exit
@@ -224,6 +226,9 @@
224226 Specify timeframe (`1m`, `5m`, `30m`, `1h`, `1d`).
225227 --timerange TIMERANGE
226228 Specify what timerange of data to use.
229+ --data-format-ohlcv {json,jsongz,hdf5}
230+ Storage format for downloaded candle (OHLCV) data.
231+ (default: `None`).
227232 --max-open-trades INT
228233 Override the value of the `max_open_trades`
229234 configuration setting.
@@ -232,6 +237,9 @@
232237 setting.
233238 --fee FLOAT Specify fee ratio. Will be applied twice (on trade
234239 entry and exit).
240+ -p PAIRS [PAIRS ...], --pairs PAIRS [PAIRS ...]
241+ Limit command to these pairs. Pairs are space-
242+ separated.
235243 --stoplosses STOPLOSS_RANGE
236244 Defines a range of stoploss values against which edge
237245 will assess the strategy. The format is "min,max,step"
modified docs/hyperopt.md +8 −3
@@ -44,8 +44,9 @@
4444 [--data-format-ohlcv {json,jsongz,hdf5}]
4545 [--max-open-trades INT]
4646 [--stake-amount STAKE_AMOUNT] [--fee FLOAT]
47- [--hyperopt NAME] [--hyperopt-path PATH] [--eps]
48- [--dmmp] [--enable-protections]
47+ [-p PAIRS [PAIRS ...]] [--hyperopt NAME]
48+ [--hyperopt-path PATH] [--eps] [--dmmp]
49+ [--enable-protections]
4950 [--dry-run-wallet DRY_RUN_WALLET] [-e INT]
5051 [--spaces {all,buy,sell,roi,stoploss,trailing,default} [{all,buy,sell,roi,stoploss,trailing,default} ...]]
5152 [--print-all] [--no-color] [--print-json] [-j JOBS]
@@ -69,6 +70,9 @@
6970 setting.
7071 --fee FLOAT Specify fee ratio. Will be applied twice (on trade
7172 entry and exit).
73+ -p PAIRS [PAIRS ...], --pairs PAIRS [PAIRS ...]
74+ Limit command to these pairs. Pairs are space-
75+ separated.
7276 --hyperopt NAME Specify hyperopt class name which will be used by the
7377 bot.
7478 --hyperopt-path PATH Specify additional lookup path for Hyperopt and
@@ -105,7 +109,8 @@
105109 reproducible hyperopt results.
106110 --min-trades INT Set minimal desired number of trades for evaluations
107111 in the hyperopt optimization path (default: 1).
108- --hyperopt-loss NAME Specify the class name of the hyperopt loss function
112+ --hyperopt-loss NAME, --hyperoptloss NAME
113+ Specify the class name of the hyperopt loss function
109114 class (IHyperOptLoss). Different functions can
110115 generate completely different results, since the
111116 target for optimization is different. Built-in
modified docs/plotting.md +4 −2
@@ -37,7 +37,7 @@
3737 optional arguments:
3838 -h, --help show this help message and exit
3939 -p PAIRS [PAIRS ...], --pairs PAIRS [PAIRS ...]
40- Show profits for only these pairs. Pairs are space-
40+ Limit command to these pairs. Pairs are space-
4141 separated.
4242 --indicators1 INDICATORS1 [INDICATORS1 ...]
4343 Set indicators from your strategy you want in the
@@ -90,6 +90,7 @@
9090 Specify strategy class name which will be used by the
9191 bot.
9292 --strategy-path PATH Specify additional strategy lookup path.
93+
9394 ```
9495
9596 Example:
@@ -244,7 +245,7 @@
244245 optional arguments:
245246 -h, --help show this help message and exit
246247 -p PAIRS [PAIRS ...], --pairs PAIRS [PAIRS ...]
247- Show profits for only these pairs. Pairs are space-
248+ Limit command to these pairs. Pairs are space-
248249 separated.
249250 --timerange TIMERANGE
250251 Specify what timerange of data to use.
@@ -286,6 +287,7 @@
286287 Specify strategy class name which will be used by the
287288 bot.
288289 --strategy-path PATH Specify additional strategy lookup path.
290+
289291 ```
290292
291293 The `-p/--pairs` argument, can be used to limit the pairs that are considered for this calculation.
modified freqtrade/commands/arguments.py +1 −1
@@ -17,7 +17,7 @@
1717 ARGS_TRADE = ["db_url", "sd_notify", "dry_run", "dry_run_wallet", "fee"]
1818
1919 ARGS_COMMON_OPTIMIZE = ["timeframe", "timerange", "dataformat_ohlcv",
20- "max_open_trades", "stake_amount", "fee"]
20+ "max_open_trades", "stake_amount", "fee", "pairs"]
2121
2222 ARGS_BACKTEST = ARGS_COMMON_OPTIMIZE + ["position_stacking", "use_max_market_positions",
2323 "enable_protections", "dry_run_wallet",
modified freqtrade/commands/cli_options.py +1 −1
@@ -330,7 +330,7 @@
330330 # Script options
331331 "pairs": Arg(
332332 '-p', '--pairs',
333- help='Show profits for only these pairs. Pairs are space-separated.',
333+ help='Limit command to these pairs. Pairs are space-separated.',
334334 nargs='+',
335335 ),
336336 # Download data
modified freqtrade/configuration/configuration.py +1 −0
@@ -445,6 +445,7 @@
445445 """
446446
447447 if "pairs" in config:
448+ config['exchange']['pair_whitelist'] = config['pairs']
448449 return
449450
450451 if "pairs_file" in self.args and self.args["pairs_file"]:
modified tests/test_configuration.py +1 −0
@@ -1002,6 +1002,7 @@
10021002 config = configuration.get_config()
10031003
10041004 assert config['pairs'] == ['ETH/BTC', 'XRP/BTC']
1005+ assert config['exchange']['pair_whitelist'] == ['ETH/BTC', 'XRP/BTC']
10051006 assert config['exchange']['name'] == 'binance'
10061007
10071008