Creating a control variable to determine the existence of max drawdown in the final result.
This commit is contained in:
parent
816bb531b3
commit
3cce668353
@ -222,10 +222,12 @@ class HyperoptTools():
|
|||||||
# Ensure compatibility with older versions of hyperopt results
|
# Ensure compatibility with older versions of hyperopt results
|
||||||
trials['results_metrics.winsdrawslosses'] = 'N/A'
|
trials['results_metrics.winsdrawslosses'] = 'N/A'
|
||||||
|
|
||||||
|
has_drawdown = True
|
||||||
if 'results_metrics.max_drawdown_abs' not in trials.columns:
|
if 'results_metrics.max_drawdown_abs' not in trials.columns:
|
||||||
# Ensure compatibility with older versions of hyperopt results
|
# Ensure compatibility with older versions of hyperopt results
|
||||||
trials['results_metrics.max_drawdown_abs'] = None
|
trials['results_metrics.max_drawdown_abs'] = None
|
||||||
trials['results_metrics.max_drawdown'] = None
|
trials['results_metrics.max_drawdown'] = None
|
||||||
|
has_drawdown = False
|
||||||
|
|
||||||
legacy_mode = True
|
legacy_mode = True
|
||||||
|
|
||||||
@ -278,7 +280,7 @@ class HyperoptTools():
|
|||||||
|
|
||||||
stake_currency = config['stake_currency']
|
stake_currency = config['stake_currency']
|
||||||
|
|
||||||
if not legacy_mode:
|
if has_drawdown:
|
||||||
trials['Max Drawdown'] = trials.apply(
|
trials['Max Drawdown'] = trials.apply(
|
||||||
lambda x: '{} {}'.format(
|
lambda x: '{} {}'.format(
|
||||||
round_coin_value(x['max_drawdown_abs'], stake_currency),
|
round_coin_value(x['max_drawdown_abs'], stake_currency),
|
||||||
|
Loading…
Reference in New Issue
Block a user