You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I find that if I pass in both a strategy and benchmark to calculate metrics, where the benchmark returns are all positive (like a cash index) the avg_loss function (quantstats.reports.metrics l.1139) ends up removing all rows as NaNs are present in every row for the benchmark, arising from the line
quantstats.stats.avg_loss l.223: returns[returns < 0].dropna().mean()
The strategy and benchmark need to be treated separately in the _stats.avg_loss function when calling dropna() ... may also be happening for _stats.avg_win function and anything else with dropna() in it.
The text was updated successfully, but these errors were encountered:
I find that if I pass in both a strategy and benchmark to calculate metrics, where the benchmark returns are all positive (like a cash index) the avg_loss function (quantstats.reports.metrics l.1139) ends up removing all rows as NaNs are present in every row for the benchmark, arising from the line
quantstats.stats.avg_loss l.223: returns[returns < 0].dropna().mean()
The strategy and benchmark need to be treated separately in the _stats.avg_loss function when calling dropna() ... may also be happening for _stats.avg_win function and anything else with dropna() in it.
The text was updated successfully, but these errors were encountered: