Skip to content

v6.16.1

Latest

Choose a tag to compare

@wallneradam wallneradam released this 02 Dec 16:28
· 8 commits to main since this release

Live bots check their clock against the venue

A broker plugin uses the venue's timestamps to tell which side of its own order update a venue event fell on, so a live bot needs a local clock that agrees with the venue's. The bot now measures this before its first bar and once a minute while it runs.

  • New optional BrokerPlugin.fetch_venue_time() returning VenueTime. The core times the reads itself and measures the local-to-venue offset as an interval, against a 500 ms limit.
  • A run that holds nothing on the venue refuses to start when the clock is proven more than 500 ms off, or when the venue's time cannot be read (a transient fault is retried first): new error code R0056. A run that restarts into its own position or orders starts with new entries blocked (entry_block, cause clock_offset) while its exits and closes keep working.
  • While running, a clock that drifts or jumps beyond 500 ms blocks new entries until a measurement proves it within the bound again; a local clock step triggers a re-measurement. An unreadable venue time while running does not stop trading, it is logged.
  • A plugin that reads no venue time starts with a WARNING that the clock is not verified.
  • Plugins can read the proven bound through the new venue_clock_bound_ms hook to narrow their own time windows.
  • The startup log line reports the measured offset, and docs/cli/broker.md has a new section on the NTP requirement.

The bar magnifier follows the chart's session grid

The bar magnifier ignored explicit session_anchors and grouped sub-bars on the grid derived from session_starts, so HKEX 60-minute windows opened at 09:30, 10:30 while chart bars open at 09:30, 10:00.

  • The magnifier and the finer-feed resample of request.security now use the same anchor-to-grid resolution as the aggregator.
  • On D/W/M charts intraday sub-bars are assigned by their session-capped last instant, and multi-day sub-bars count as their days on observed nD grids, as aggregate_ohlcv does.

Live broker fixes

  • A modify of a partial bracket whose leg holds a close now waits until that close settles. Before, contract rounding on an inverse pair could make the modify hit the scale-out sibling guard and end the run.
  • The two coexistence refusals in the modify path (a whole-row replacement beside scale-out sibling legs, a native-to-partial conversion beside a native sibling exit) no longer raise and end the run: they log one ERROR per intent key and defer the modify, with the existing protection kept armed.
  • A binding book that went flat no longer drops every fill cursor at once. A position reopened within the restart check's one-minute slack (a reversal on a hedged account) could otherwise have its faithful book rejected on restart and adopted FIFO.
  • One-way emulator: PositionPort.amend_bracket may return False when the venue answer does not confirm the requested levels. Nothing is cached, the leg is re-driven later, and the software guard stays until a venue bracket is confirmed.
  • One-way emulator: confirmed bracket levels are re-read before a write is skipped once a leg read, a leg close or a routed fill puts them in doubt, so a reused hedge leg id cannot keep a stale bracket.
  • A throttled one-way bracket attach or modify is retried on the next sync instead of being parked as an unknown write. A queued re-drive survives a transient fault or a journal read failure.
  • The order stream is stopped once on shutdown so its cleanup can finish.

Broker plugin API

  • New optional native_failsafe_withheld_sink: a plugin that keeps a parent's native fail-safe stop off the venue on purpose publishes the set of such parents. New entries on that symbol are blocked (skip reason native_failsafe_withheld_entry) while closes and exits are unaffected. The contract is documented in the plugin authoring guide.
  • New optional fetch_venue_time() and venue_clock_bound_ms (see above).

Other

  • pyne-transform: new public-lib-routes Cargo feature that leaves routes for private functions of Pyne lib modules out of the generated route table. The Python extension and the WebAssembly entry refuse to build with it. Without the feature the table is unchanged.
  • Documentation: the TradingView validation snapshot is updated to 2026-12-02 (1,010 published scripts, 1,366 comparable outputs matching, 99.772% of 133 million plotted values bit-identical, 355,164 strategy trades).