moved line for total_downside
This commit is contained in:
parent
a46b7bcd6d
commit
e8b9d88eb6
@ -47,12 +47,12 @@ class SortinoHyperOptLossDaily(IHyperOptLoss):
|
|||||||
)
|
)
|
||||||
|
|
||||||
total_profit = sum_daily["profit_percent_after_slippage"] - risk_free_rate
|
total_profit = sum_daily["profit_percent_after_slippage"] - risk_free_rate
|
||||||
total_downside = sum_daily['downside_returns'] - risk_free_rate
|
|
||||||
expected_returns_mean = total_profit.mean()
|
expected_returns_mean = total_profit.mean()
|
||||||
|
|
||||||
sum_daily['downside_returns'] = 0
|
sum_daily['downside_returns'] = 0
|
||||||
sum_daily.loc[total_profit < 0,
|
sum_daily.loc[total_profit < 0,
|
||||||
'downside_returns'] = sum_daily['profit_percent_after_slippage']
|
'downside_returns'] = sum_daily['profit_percent_after_slippage']
|
||||||
|
total_downside = sum_daily['downside_returns'] - risk_free_rate
|
||||||
down_stdev = total_downside.std()
|
down_stdev = total_downside.std()
|
||||||
|
|
||||||
if (down_stdev != 0.):
|
if (down_stdev != 0.):
|
||||||
|
Loading…
Reference in New Issue
Block a user