Skip to content

v6.8.4

Latest

Choose a tag to compare

@wallneradam wallneradam released this 12 Aug 10:38
· 1 commit to main since this release

TradingView compatibility

  • ta functions now truncate an int-typed fractional length the way TradingView does. Pine's int / int is int-typed but keeps its fractional value, and the truncation happens where an integer is actually required: R / 8 with R = 14 plots 1.75, yet ta.highest(R / 8) equals ta.highest(1). cog, highest, linreg, lowest, pivothigh, pivotlow, sma and valuewhen now truncate the value themselves; ta.sma in particular was dividing a truncated window by the untruncated length. Overload resolution accepts a float where an int parameter is expected only in the non-strict pass, so no call that resolved before can change its selection.

Fixes

  • Live runs: a reconnect hook that fails is now retried before streams resume, and the failure stays quarantined until the handshake succeeds — including across session boundaries such as market close and reopen. Previously a failed hook could leave a strategy running against a stream it had not re-initialized.
  • Function isolation: a nested call inside a callee attribute chain (f().g(), a[f()].g()) now gets its own call site, so a state-carrying inner callee receives its state. A callee expression that runs code is bound to a temporary once instead of being emitted twice, which evaluated its side effects twice.
  • A stateful call inside a comprehension iterable previously emitted an assignment expression Python rejects and failed to compile; comprehension iterables now use walrus-free helper forms.
  • Generated temporaries moved to a reserved middle-dot spelling and the runtime helpers are imported under aliases, so a user name of the same spelling can no longer shadow or silently overwrite them. Pyne code binding an identifier containing the reserved middle dot is now rejected with a SyntaxError naming it; strings, comments and docstrings stay unrestricted.
  • CSV writer: flush() now waits for the worker to acknowledge the file write, so it can no longer return with rows still buffered, and a failing final drain is recorded instead of swallowed. A dying worker drains the queue and releases waiters instead of leaving them blocked forever, close(timeout=...) raises TimeoutError and leaves the file and worker intact when the thread has not stopped, and the idle branch writes any non-empty buffer rather than only a half-full one.
  • CCXTProvider: removed a broken duplicate of _create_24_7_sessions that referenced an undefined name, and tightened the config and async-client type hints.
  • HTFAggregator: clarified how the new-period state is determined.

Features

  • New --no-plot switch for pyne run, for live runs where the plot CSV would otherwise grow without bound.

Performance

  • ta.dev, ta.linreg and ta.wma — and through them ta.cci and ta.hma — read their window through a property instead of a method call, removing a per-bar rebind and a duplicate view construction. Measured over 525,600 bars: 23.2% faster wall-clock on a wma + hma + linreg + dev + cci script, with byte-identical plot, stats and trade output.
  • Overload dispatch keeps a positional-only shortcut keyed by the raw argument types, so a hit costs one map(type) and one dict lookup instead of building the nested token key; it latches off permanently on the first call where it cannot apply, so na and container arguments never pay for it.
  • Per-bar library values are written through the module dict instead of module attributes, and SeriesImpl.add reads bar_index once and inlines its push body. Together with the dispatcher shortcut: 1.8-3.8% faster wall-clock on the 525,600-bar benchmark, with plot, stats and trade output unchanged on all four gate scripts.
  • SeriesImpl.__getitem__ tests int first; the default float format uses repr() instead of '{:}'.format, guarded on the exact float type; the per-call from .. import lib binds in plot, dayofweek, request and currency are cached after the first lookup; and the progress channel is a single slot instead of a queue whose backlog was discarded.