use profit_abs

This commit is contained in:
sid 2021-10-07 08:07:07 +05:30
parent 93e4cf4006
commit 46c320513a
1 changed files with 2 additions and 2 deletions

View File

@ -32,9 +32,9 @@ class MaxDrawDownHyperOptLoss(IHyperOptLoss):
Uses profit ratio weighted max_drawdown when drawdown is available.
Otherwise directly optimizes profit ratio.
"""
total_profit = results['profit_ratio'].sum()
total_profit = results['profit_abs'].sum()
try:
max_drawdown = calculate_max_drawdown(results)
max_drawdown = calculate_max_drawdown(results, value_col='profit_abs')
except ValueError:
# No losing trade, therefore no drawdown.
return -total_profit