Skip to main content
Design your scripts around these limits.

Execution budget

Each run of compute has a 1000 ms budget. A script that exceeds it is disabled until you edit it. Keep loops proportional to the number of bars and avoid rescanning the whole series for every bar.

Synchronous only

No async, fetch or timers. compute must return its result directly.

Sandbox

Scripts run isolated from the terminal page. There is no window, document, storage, network access, eval, new Function or import(). Only plain JavaScript built-ins, console and performance.now() are available. Intl.DateTimeFormat works for time zone math. Return plain data: numbers, strings, arrays and objects.

No persistence

Nothing is kept between runs. Model “current state” by replaying your rules over the series inside compute. See the signal engine example.

Caps

History depth

A script sees the bars the chart has loaded. By default that is about: Panning back loads more history and re-runs the script.

Not supported

  • Restyling the main price series (Pine plotcandle and barcolor).
  • Filling between two plots (Pine fill). Plot the two boundaries, or draw boxes.
  • Alerts from scripts (Pine alertcondition). Price alerts are a separate terminal feature.