Add pairlist to backtest-result
This commit is contained in:
parent
59ac4b9c9a
commit
59e0ca0aaa
@ -250,6 +250,7 @@ def generate_backtest_stats(config: Dict, btdata: Dict[str, DataFrame],
|
|||||||
'backtest_days': backtest_days,
|
'backtest_days': backtest_days,
|
||||||
'trades_per_day': round(len(results) / backtest_days, 2) if backtest_days > 0 else None,
|
'trades_per_day': round(len(results) / backtest_days, 2) if backtest_days > 0 else None,
|
||||||
'market_change': market_change,
|
'market_change': market_change,
|
||||||
|
'pairlist': list(btdata.keys()),
|
||||||
'stake_amount': config['stake_amount']
|
'stake_amount': config['stake_amount']
|
||||||
}
|
}
|
||||||
result['strategy'][strategy] = strat_stats
|
result['strategy'][strategy] = strat_stats
|
||||||
|
@ -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'] == Arrow.fromtimestamp(0).datetime
|
||||||
assert strat_stats['drawdown_end_ts'] == 0
|
assert strat_stats['drawdown_end_ts'] == 0
|
||||||
assert strat_stats['drawdown_start_ts'] == 0
|
assert strat_stats['drawdown_start_ts'] == 0
|
||||||
|
assert strat_stats['pairlist'] == ['UNITTEST/BTC']
|
||||||
|
|
||||||
# Test storing stats
|
# Test storing stats
|
||||||
filename = Path(testdatadir / 'btresult.json')
|
filename = Path(testdatadir / 'btresult.json')
|
||||||
@ -136,6 +137,7 @@ def test_generate_backtest_stats(default_conf, testdatadir):
|
|||||||
content = filename1.read_text()
|
content = filename1.read_text()
|
||||||
assert 'max_drawdown' in content
|
assert 'max_drawdown' in content
|
||||||
assert 'strategy' in content
|
assert 'strategy' in content
|
||||||
|
assert 'pairlist' in content
|
||||||
|
|
||||||
assert filename_last.is_file()
|
assert filename_last.is_file()
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
2
tests/testdata/backtest-result_new.json
vendored
2
tests/testdata/backtest-result_new.json
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user