Skip to content

v6.10.8

Choose a tag to compare

@wallneradam wallneradam released this 08 Oct 08:40
· 6 commits to main since this release

Fixes

Libraries

  • Library export validation: exported functions may reference library constants, but capturing non-constant variables from the module or library main() scope is now rejected by the AST validator, including helpers and default arguments reached by an export. Applies to handwritten Pyne code and to libraries run directly as the main script.
  • Imported library drawings suppressed: when a library is imported, drawing constructors and copies called by its main() (and its helpers) return typed na handles without allocating or registering drawings; setters and deletion on those handles are no-ops. The library still draws normally when run as the main script, and exported functions called by the importing script create normal drawings.
  • Alerts suppressed in imported library mains and request.security workers: alert() calls made while an imported library's main() runs, or inside security workers replaying the script, no longer produce duplicate output.
  • Imported enum constants in library exports: enum constants imported from another module are recognized as constants by the export capture check; the cached bytecode is revalidated when the source files consulted for that proof change.
  • Exported state preserved: state walkers now reach a library export's bindings through the bool-mode guard, so per-call-site state of exported functions is carried and rolled back correctly.

request.security

  • Boolean defaults: a missing bool result (including bool elements of a returned tuple) now gets a proper bool na default that follows the running script's bool mode.
  • Resolved inputs reused in security replicas: security processes now receive the resolved input and setting values of the main script (including TOML and programmatic overrides) instead of re-resolving them; enum and color values are transported correctly.
  • Drawings rejected in request expressions: label.new, line.new, box.new, table.new, polyline.new, linefill.new and the corresponding copy functions are rejected in request.security / security_lower_tf expressions and their local helper and variable dependencies, at AST validation time.

Plots

  • Plot declarations validated at transform time: plot and the other declaration builtins (plotshape, plotchar, plotarrow, plotcandle, plotbar, hline, fill, bgcolor, barcolor, alertcondition) must execute unconditionally in the direct body of main(), before any early return. Violations now raise a source-located SyntaxError during AST transformation instead of a RuntimeError on the first bar. Import aliases and single static function aliases are supported.

Builtins and compiler transforms

  • timeframe.change(): the timeframe argument is now optional; omitted or empty uses the chart timeframe.
  • Module constant folding inside functions: immutable module-level constants are folded inside functions with exact numeric values and their Pine types preserved, while respecting rebinding, shadowing and state containers.

Broker / live trading

  • Market-closed rejects are non-terminal: a new MarketClosedError represents a venue declining a dispatch because the instrument is not tradable right now (session pause, maintenance break, halt). The sync engine no longer treats it as a fatal exit/close reject: the dispatch is dropped and re-evaluated once trading resumes (entry skipped, close gated to the next bar, exit re-sent on the next sync, reversal close parked). Measured live: a reversal close dispatched into a 21:00 UTC maintenance pause previously killed the run.
  • Rotated restart entry orders adopted: after a script rotation, predecessor-tagged live entries are reconstructed, journal rows are matched by the venue order IDs stored in extras, and cancelled restart orders are forgotten so later entries dispatch with fresh IDs.
  • Reversal close settle timeout honored: a reversal close is not redispatched before execute_timeout, even after the stale-sync threshold is reached.
  • Reversals covered by a fresh close are deferred, covering staggered close fills.
  • Spot conflict quarantine deferred for in-flight fills: the execution cursor is held while balance drift remains unexplained so late venue history can be recovered; quarantine grace stays armed while live bot orders cover the drift.
  • Recovery bridge timeouts surface as unknown dispositions, so callers can park and retry instead of failing.

Data providers

  • CCXT: transient candle download errors (network errors and unmapped exchange errors) are retried with exponential backoff.

Performance

  • Native color.new: an optional compiled implementation of color.new ships in the platform wheels, tested against the pure-Python code it replaces; installs without a compiler fall back to pure Python.
  • Timestamp components cached at pinned call sites, via a bounded shared cache plus a per-call-site last result.
  • strategy.close() / strategy.close_all() call sites: transformed direct calls use a baked source stamp instead of a frame-based call-site lookup.
  • Shared plot metadata cache: plot metadata serialization is cached across visualization readers. New pynecore.core.viz.collect_meta_changes(cursor) lets host consumers read metadata updates with their own cursor without consuming the native writer's queue. Initial plot metadata now precedes the first bar record (also for plots whose initial values are na), and an in-place modified referenced Color emits a new meta record.

Documentation

  • alert() reference: clarified output behavior, suppressed contexts, alertcondition compatibility and direct notifications through Python libraries, with realtime guards in live mode.
  • Updated plot, request, script format and visual output references for the changes above.