Rename risk_free_return to minumum_accepted_return

This commit is contained in:
hroff-1902 2020-02-16 03:55:16 +03:00
parent b2328cdf4f
commit 161dd1a3e6

View File

@ -31,8 +31,7 @@ class SortinoHyperOptLossDaily(IHyperOptLoss):
resample_freq = '1D' resample_freq = '1D'
slippage_per_trade_ratio = 0.0005 slippage_per_trade_ratio = 0.0005
days_in_year = 365 days_in_year = 365
annual_risk_free_rate = 0.0 minimum_acceptable_return = 0.0
risk_free_rate = annual_risk_free_rate / days_in_year
# apply slippage per trade to profit_percent # apply slippage per trade to profit_percent
results.loc[:, 'profit_percent_after_slippage'] = \ results.loc[:, 'profit_percent_after_slippage'] = \
@ -47,7 +46,7 @@ class SortinoHyperOptLossDaily(IHyperOptLoss):
{"profit_percent_after_slippage": sum}).reindex(t_index).fillna(0) {"profit_percent_after_slippage": sum}).reindex(t_index).fillna(0)
) )
total_profit = sum_daily["profit_percent_after_slippage"] - risk_free_rate total_profit = sum_daily["profit_percent_after_slippage"] - minimum_acceptable_return
expected_returns_mean = total_profit.mean() expected_returns_mean = total_profit.mean()
sum_daily['downside_returns'] = 0 sum_daily['downside_returns'] = 0