Skip to content

v6.13.1

Choose a tag to compare

@wallneradam wallneradam released this 08 Nov 21:24
· 19 commits to main since this release

Features

  • Coin-flip backtests run in parallel and stop early. The coin-flip tests that run a backtest per draw (timing, and direction with --exact) take two new options of pyne robustness:
    • --jobs / -j runs that many backtests at the same time, each in its own process (default: the CPU count minus one). Worker processes can start request.security contexts, use the same timenow as the main backtest and do not rewrite the script's TOML.
    • --early-stop edge|better|off stops the test once its verdict is clear: edge (default) once it is clear whether the real rules beat 95% of the random draws, better once it is clear whether they beat half of them, off runs every backtest. The test is checked after 30 backtests and every 10 after that, with a 99% Wilson interval, always on the first draws in draw order, so the result does not depend on the number of workers. The verdict says when and why the test stopped, and the JSON result gains planned and stop_reason.
    • From Python, direction_test, timing_test and coinflip_test take jobs and early_stop (default jobs=1, early_stop='off'). With more than one job, make_runner must be picklable.

Fixes

  • Coin-flip direction test: a flipped entry exposed the broker-side sign through strategy.position_size, strategy.opentrades.size() and strategy.closedtrades.size(). A script deriving its bracket from that sign placed no exit, so the flipped backtest barely traded and the test reported a meaningless "beats 100%". These now carry the sign of the entry the script placed; money and prices stay the real ones. The fast path gives no verdict when fewer than 90% of the real trades pair with the flipped backtest and points to --exact instead; the JSON result gains a valid flag and writes null for the undefined percentile and share.
  • Broker:
    • A transient venue read fault during the startup reconcile (for example an execution index still behind a fill that landed during the restart) no longer ends the run before its first bar. The reconcile retries with a doubling wait capped at 60 s; other errors still propagate.
    • On an inverse market, pyramid legs of the same contract count book different base quantities, so a FIFO close of one leg could leave another a remainder below one contract, which no exit can trade. A plugin can now report the smallest tradable quantity (BrokerPlugin.least_tradable_qty(price), default 0.0 keeps every remainder). A remainder below it is spread over the other open trades with its entry cost, so the trades still add up to the venue position and the closes book the P&L of the fills.
    • The flat-book orphan exit sweep logs at INFO instead of WARNING, and a failed open-orders read during the reduce-coverage check reports through the shared read-outage throttle instead of warning on every reconcile pass.

Build

  • A failed gate or wheel build job cancels the whole release run instead of letting the other jobs run to their end.