Skip to content

v0.0.84

Choose a tag to compare

@ranaroussi ranaroussi released this 26 Sep 19:58
· 2 commits to main since this release

Fixes a regression introduced in 0.0.83.

Fixed

  • greeks(), r_squared()/r2() and treynor_ratio() broke on any gap (#553).
    0.0.83 stopped filling missing observations with 0, and np.cov/linregress
    propagate NaN through the entire estimate, so a single absent day reduced beta
    and alpha to 0 and R-squared to NaN — and greeks() 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 fraction p - q/b again (#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.