Skip to content

v6.5.1

Choose a tag to compare

@wallneradam wallneradam released this 22 Jun 17:20

PyneCore 6.5.1 is a correctness and performance release on the 6.5 line, fixing TradingView-parity divergences across the strategy simulator, request.security, the standard library, time/timeframe handling and the compiler, with hot-path speedups on the drawing, array and overload code.

Strategy simulation

  • Same-bar close_all after a partial close no longer overshoots into a phantom opposite trade.
  • Multiple same-bar partial closes for one entry id now all fill instead of evicting each other.
  • A sub-lot margin-call shortfall closes a single contract, not the whole position.
  • immediately=True closes now book their cumulative stats correctly.
  • Added strategy.netprofit_percent, strategy.openprofit_percent and strategy.max_drawdown_percent.

request.security / higher-timeframe

  • Sparse single-period D/W/M feeds keep their gaps_off forward-fill instead of writing na.
  • HTF barmerge.lookahead_off confirms on the period's own last chart bar, not one bar late (#66).
  • Tuple request.security_lower_tf returns one array per element again.
  • The per-chart-bar LTF handshake is skipped before the feed begins (faster idle prefix).

Standard library

  • array.new_*(na) creates an empty array; empty-array reducers return na instead of raising.
  • Array methods dispatch on array.slice() (SequenceView) receivers.
  • str.contains(na, ...) no longer hangs; str.format_time(na) and out-of-range timestamp(...) follow Pine.
  • ta.correlation, ta.crossover and ta.crossunder stay valid across na gaps in the window.
  • An na series subscript resolves to the current bar (high[na] == high[0]), matching TradingView.

Time, timeframe and bar aggregation

  • Bars close at the trading-day end; daily bars anchor to the session open.
  • Multi-period D/W/M aggregation (2D, 3W...) is trading-day- and holiday-aware (#65).
  • last_bar_index stays fixed at the dataset tail on history, so last-N-bar guards work.

Compiler / transformers

  • Emitted builtin calls are shadow-proof against user names like len or getattr.
  • inline_series history is materialized every bar in short-circuited (ternary, and/or) positions.
  • Overload instance state (ta.*, Persistent) survives the per-bar swap in library mains.
  • A library alias shadowing a built-in namespace falls back to the built-in for unexported names.

Performance

  • O(1) identity-keyed drawing registries that enforce Pine's max_*_count caps.
  • Overload dispatch memoizes implementation selection per call shape.
  • pine_range returns a native range for integer for-loop bounds; array.get drops a runtime cast.