PyneCore v6.8.1 released — a release about scripts that used to stop dead: most of these…

Fixes

  • An na array index no longer halts array.get, set, remove, insert, slice, fill, percentrank, max, min or the percentile functions — TradingView’s measured answers are returned instead
  • A float index, from a division or math.round, is truncated across the array and matrix namespaces instead of halting
  • for row in m over a matrix works, and an array.slice view is writable and live: push, insert, pop, clear no longer raise
  • request.seed keeps the arity of a tuple expression, so the compiled destructuring no longer dies on “na is not iterable”
  • str.split with an empty separator splits into characters, str.replace picks the right occurrence, and math.random without a seed no longer returns na on every draw
  • Discarded body executions — calc_on_order_fills, live ticks — no longer leave their drawings and plot columns behind, and a Pine .copy() on a label, line or box registers the clone instead of orphaning it
  • time(timeframe="1M", timeframe_bars_back=1) landed in the wrong month on an uneven grid
  • More than a dozen parameter names now match Pine’s spelling, so a named argument stops raising TypeError (str.contains, math.toradians, color.rgb, ta.alma, str.replace, na, map.put_all and others)

Features

  • strategy.opentrades.capital_held, array.new_table, and four new label setters
  • Overload dispatch selects on the exact argument type, including a typed na

Performance

  • The na guard on the per-bar path: 18.3 ns to 5.8 ns for a non-na value; na(float) from 0.147 s to 0.039 s per million calls

Full release notes: https://github.com/PyneSys/pynecore/releases/tag/v6.8.1