Skip to content

v0.5.0

Latest

Choose a tag to compare

@github-actions github-actions released this 17 Jul 09:09
· 1 commit to main since this release

Added

Tier 1 visual outputs (oakscriptjs/script):

  • plotshape(condition, title?, options) and plotchar(condition, title?, options) — per-bar markers where the condition holds. Options: style, location (abovebar/belowbar/top/bottom/absolute), color, text, textcolor, size, offset, and tooltip (extension over PineScript, for label ports). Emitted as IndicatorResult.markers (MarkerData[]); declared as ShapeConfig.
  • bgcolor(colors, options?) and barcolor(colors, options?) — per-bar background / candle colors from a static color or a per-bar array. Emitted as IndicatorResult.bgcolors / barcolors (BarColorData[]); declared as BarColorConfig.
  • color.when(cond, colorTrue, colorFalse?)colorFalse is now optional; an omitted false-color leaves the bar uncolored (PineScript na), which bgcolor()/barcolor() skip.

Per-bar execution:

  • eachBar(fn) — runs a callback once per bar and collects the returns into a Series. Inside the callback values are plain numbers, so native JS operators, if/for/while and closure let variables replace PineScript var/:=/loops. c.get(src, k) is src[k], c.prev(k) is self-reference, c.i is bar_index. seriesOf(values) wraps a side-output array as a Series.

Candlestick pattern port:

  • All 45 official TradingView candlestick indicators ported to the script API over a shared candle-props / pattern-runner template, including the All Candlestick Patterns composite, plus a lightweight-charts v5 example renderer (markers + bgcolor primitive).

Changed

  • ScriptRunResult gained shapeConfig and barColorConfig; IndicatorResult gained optional markers, bgcolors, barcolors. All additive — existing consumers are unaffected.
  • Fixed the stale VERSION constant (was 0.3.0).

Full Changelog: v0.3.0...v0.5.0