Add pairlist to backtest-result

This commit is contained in:
Matthias 2020-06-28 09:04:19 +02:00
parent 59ac4b9c9a
commit 59e0ca0aaa
4 changed files with 5 additions and 2 deletions

View File

@ -250,6 +250,7 @@ def generate_backtest_stats(config: Dict, btdata: Dict[str, DataFrame],
'backtest_days': backtest_days,
'trades_per_day': round(len(results) / backtest_days, 2) if backtest_days > 0 else None,
'market_change': market_change,
'pairlist': list(btdata.keys()),
'stake_amount': config['stake_amount']
}
result['strategy'][strategy] = strat_stats

View File

@ -118,6 +118,7 @@ def test_generate_backtest_stats(default_conf, testdatadir):
assert strat_stats['drawdown_end'] == Arrow.fromtimestamp(0).datetime
assert strat_stats['drawdown_end_ts'] == 0
assert strat_stats['drawdown_start_ts'] == 0
assert strat_stats['pairlist'] == ['UNITTEST/BTC']
# Test storing stats
filename = Path(testdatadir / 'btresult.json')
@ -136,6 +137,7 @@ def test_generate_backtest_stats(default_conf, testdatadir):
content = filename1.read_text()
assert 'max_drawdown' in content
assert 'strategy' in content
assert 'pairlist' in content
assert filename_last.is_file()

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long