Repository navigation
v0.0.84
Fixes a regression introduced in 0.0.83.
Fixed
-
greeks(),r_squared()/r2()andtreynor_ratio()broke on any gap (#553).
0.0.83 stopped filling missing observations with 0, andnp.cov/linregress
propagateNaNthrough the entire estimate, so a single absent day reduced beta
and alpha to0and R-squared toNaN— andgreeks()reported that zero without
complaint. These are now estimated over the dates on which both the strategy and
the benchmark were observed.reports.metrics()was not affected.Reported, diagnosed and fixed by @WatchTree-19, whose patch this release follows.
Reverted
-
kelly_criterion()returns the classic fixed-odds fractionp - q/bagain (#552),
as it did up to 0.0.81. 0.0.82 divided it by the average-loss magnitude, on the
argument that a fraction which does not move when the return series is rescaled must
be wrong. That quantity is the growth-optimal leverage for a per-period P&L, not the
Kelly fraction: on daily returns it reaches double and triple digits, and reports showed
figures like 10792% where the fraction reads 21%. The fixed-odds fraction depends only
on the odds by construction, so its scale-invariance is a property rather than a defect.Thanks to @none2003 for the report and the before/after numbers.
If you installed 0.0.83 and use a benchmark, upgrading is recommended.