use profit_abs
This commit is contained in:
parent
93e4cf4006
commit
46c320513a
@ -32,9 +32,9 @@ class MaxDrawDownHyperOptLoss(IHyperOptLoss):
|
|||||||
Uses profit ratio weighted max_drawdown when drawdown is available.
|
Uses profit ratio weighted max_drawdown when drawdown is available.
|
||||||
Otherwise directly optimizes profit ratio.
|
Otherwise directly optimizes profit ratio.
|
||||||
"""
|
"""
|
||||||
total_profit = results['profit_ratio'].sum()
|
total_profit = results['profit_abs'].sum()
|
||||||
try:
|
try:
|
||||||
max_drawdown = calculate_max_drawdown(results)
|
max_drawdown = calculate_max_drawdown(results, value_col='profit_abs')
|
||||||
except ValueError:
|
except ValueError:
|
||||||
# No losing trade, therefore no drawdown.
|
# No losing trade, therefore no drawdown.
|
||||||
return -total_profit
|
return -total_profit
|
||||||
|
Loading…
Reference in New Issue
Block a user