As -sharp_ratio is returned the value should be nagative.
This leads in a high positive result of the loss function, as it is a minimal optimizer
This commit is contained in:
parent
02b2de5c73
commit
8ad5afd3a1
@ -39,7 +39,7 @@ class SharpeHyperOptLoss(IHyperOptLoss):
|
|||||||
sharp_ratio = expected_yearly_return / np.std(total_profit) * np.sqrt(365)
|
sharp_ratio = expected_yearly_return / np.std(total_profit) * np.sqrt(365)
|
||||||
else:
|
else:
|
||||||
# Define high (negative) sharpe ratio to be clear that this is NOT optimal.
|
# Define high (negative) sharpe ratio to be clear that this is NOT optimal.
|
||||||
sharp_ratio = 20.
|
sharp_ratio = -20.
|
||||||
|
|
||||||
# print(expected_yearly_return, np.std(total_profit), sharp_ratio)
|
# print(expected_yearly_return, np.std(total_profit), sharp_ratio)
|
||||||
return -sharp_ratio
|
return -sharp_ratio
|
||||||
|
Loading…
Reference in New Issue
Block a user