Update hyperopt_loss_calmar.py

This commit is contained in:
Robert Roman 2021-10-25 00:45:10 -05:00 committed by GitHub
parent 5f309627ea
commit 88b96d5d1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -54,7 +54,7 @@ class CalmarHyperOptLoss(IHyperOptLoss):
except ValueError:
max_drawdown = 0
if max_drawdown != 0 and trade_count > 2000:
if max_drawdown != 0:
calmar_ratio = expected_returns_mean / max_drawdown * msqrt(365)
else:
# Define high (negative) calmar ratio to be clear that this is NOT optimal.