.agg would like strings, not the sum function.
This commit is contained in:
parent
2c1457fb95
commit
5073c780d8
@ -44,7 +44,7 @@ class SharpeHyperOptLossDaily(IHyperOptLoss):
|
|||||||
|
|
||||||
sum_daily = (
|
sum_daily = (
|
||||||
results.resample(resample_freq, on='close_date').agg(
|
results.resample(resample_freq, on='close_date').agg(
|
||||||
{"profit_ratio_after_slippage": sum}).reindex(t_index).fillna(0)
|
{"profit_ratio_after_slippage": 'sum'}).reindex(t_index).fillna(0)
|
||||||
)
|
)
|
||||||
|
|
||||||
total_profit = sum_daily["profit_ratio_after_slippage"] - risk_free_rate
|
total_profit = sum_daily["profit_ratio_after_slippage"] - risk_free_rate
|
||||||
|
@ -46,7 +46,7 @@ class SortinoHyperOptLossDaily(IHyperOptLoss):
|
|||||||
|
|
||||||
sum_daily = (
|
sum_daily = (
|
||||||
results.resample(resample_freq, on='close_date').agg(
|
results.resample(resample_freq, on='close_date').agg(
|
||||||
{"profit_ratio_after_slippage": sum}).reindex(t_index).fillna(0)
|
{"profit_ratio_after_slippage": 'sum'}).reindex(t_index).fillna(0)
|
||||||
)
|
)
|
||||||
|
|
||||||
total_profit = sum_daily["profit_ratio_after_slippage"] - minimum_acceptable_return
|
total_profit = sum_daily["profit_ratio_after_slippage"] - minimum_acceptable_return
|
||||||
|
Loading…
Reference in New Issue
Block a user