fixed method arguments indentation
This commit is contained in:
parent
e8439ae0bc
commit
c541ae7266
@ -20,14 +20,9 @@ class SharpeHyperOptLossDaily(IHyperOptLoss):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def hyperopt_loss_function(
|
def hyperopt_loss_function(results: DataFrame, trade_count: int,
|
||||||
results: DataFrame,
|
min_date: datetime, max_date: datetime,
|
||||||
trade_count: int,
|
*args, **kwargs) -> float:
|
||||||
min_date: datetime,
|
|
||||||
max_date: datetime,
|
|
||||||
*args,
|
|
||||||
**kwargs
|
|
||||||
) -> float:
|
|
||||||
"""
|
"""
|
||||||
Objective function, returns smaller number for more optimal results.
|
Objective function, returns smaller number for more optimal results.
|
||||||
|
|
||||||
@ -50,6 +45,6 @@ class SharpeHyperOptLossDaily(IHyperOptLoss):
|
|||||||
sharp_ratio = expected_returns_mean / np.std(total_profit) * np.sqrt(365)
|
sharp_ratio = expected_returns_mean / 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.0
|
sharp_ratio = -20.
|
||||||
|
|
||||||
return -sharp_ratio
|
return -sharp_ratio
|
||||||
|
Loading…
Reference in New Issue
Block a user