added daily sharpe ratio test and modified hyperopt_loss_sharpe_daily

This commit is contained in:
Yazeed Al Oyoun
2020-01-31 22:16:44 +01:00
parent c4e303aa66
commit 08011c82e2
2 changed files with 27 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
"""
SharpeHyperOptLoss
SharpeHyperOptLossDaily
This module defines the alternative HyperOptLoss class which can be used for
Hyperoptimization.
@@ -43,7 +43,7 @@ class SharpeHyperOptLossDaily(IHyperOptLoss):
* 100.0
)
if np.std(results.profit_percent) != 0.0:
if (np.std(sum_daily.profit_percent) != 0.):
sharp_ratio = (
sum_daily["profit_percent"].mean()
/ sum_daily["profit_percent"].std()