mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-14 04:03:55 +00:00
Maintain compatibility with old backtest results
This commit is contained in:
parent
1e2523af61
commit
3f64c6307f
|
@ -733,6 +733,26 @@ def text_table_add_metrics(strat_results: Dict) -> str:
|
||||||
strat_results['stake_currency'])),
|
strat_results['stake_currency'])),
|
||||||
] if strat_results.get('trade_count_short', 0) > 0 else []
|
] if strat_results.get('trade_count_short', 0) > 0 else []
|
||||||
|
|
||||||
|
drawdown_metrics = []
|
||||||
|
if 'max_relative_drawdown' in strat_results:
|
||||||
|
# Compatibility to show old hyperopt results
|
||||||
|
drawdown_metrics.append(
|
||||||
|
('Max % of account underwater', f"{strat_results['max_relative_drawdown']:.2%}")
|
||||||
|
)
|
||||||
|
drawdown_metrics.extend([
|
||||||
|
('Absolute Drawdown (Account)', f"{strat_results['max_drawdown_account']:.2%}")
|
||||||
|
if 'max_drawdown_account' in strat_results else (
|
||||||
|
'Drawdown', f"{strat_results['max_drawdown']:.2%}"),
|
||||||
|
('Absolute Drawdown', round_coin_value(strat_results['max_drawdown_abs'],
|
||||||
|
strat_results['stake_currency'])),
|
||||||
|
('Drawdown high', round_coin_value(strat_results['max_drawdown_high'],
|
||||||
|
strat_results['stake_currency'])),
|
||||||
|
('Drawdown low', round_coin_value(strat_results['max_drawdown_low'],
|
||||||
|
strat_results['stake_currency'])),
|
||||||
|
('Drawdown Start', strat_results['drawdown_start']),
|
||||||
|
('Drawdown End', strat_results['drawdown_end']),
|
||||||
|
])
|
||||||
|
|
||||||
# Newly added fields should be ignored if they are missing in strat_results. hyperopt-show
|
# Newly added fields should be ignored if they are missing in strat_results. hyperopt-show
|
||||||
# command stores these results and newer version of freqtrade must be able to handle old
|
# command stores these results and newer version of freqtrade must be able to handle old
|
||||||
# results with missing new fields.
|
# results with missing new fields.
|
||||||
|
@ -788,19 +808,7 @@ def text_table_add_metrics(strat_results: Dict) -> str:
|
||||||
('Max balance', round_coin_value(strat_results['csum_max'],
|
('Max balance', round_coin_value(strat_results['csum_max'],
|
||||||
strat_results['stake_currency'])),
|
strat_results['stake_currency'])),
|
||||||
|
|
||||||
# Compatibility to show old hyperopt results
|
*drawdown_metrics,
|
||||||
('Max % of account underwater', f"{strat_results['max_relative_drawdown']:.2%}"),
|
|
||||||
('Absolute Drawdown (Account)', f"{strat_results['max_drawdown_account']:.2%}")
|
|
||||||
if 'max_drawdown_account' in strat_results else (
|
|
||||||
'Drawdown', f"{strat_results['max_drawdown']:.2%}"),
|
|
||||||
('Absolute Drawdown', round_coin_value(strat_results['max_drawdown_abs'],
|
|
||||||
strat_results['stake_currency'])),
|
|
||||||
('Drawdown high', round_coin_value(strat_results['max_drawdown_high'],
|
|
||||||
strat_results['stake_currency'])),
|
|
||||||
('Drawdown low', round_coin_value(strat_results['max_drawdown_low'],
|
|
||||||
strat_results['stake_currency'])),
|
|
||||||
('Drawdown Start', strat_results['drawdown_start']),
|
|
||||||
('Drawdown End', strat_results['drawdown_end']),
|
|
||||||
('Market change', f"{strat_results['market_change']:.2%}"),
|
('Market change', f"{strat_results['market_change']:.2%}"),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user