Docs·Web App·Widgets

Custom Scripts widget

Write and run DeltaDSL custom indicator scripts inside the terminal. Side-docked editor + live preview pane that shares the same chart context as your built-in indicators. Author once, run on any symbol or timeframe.

The Custom Scripts widget brings the DeltaDSL script editor directly into the terminal — same editor as the standalone Custom Script dialog, docked beside the chart so you can iterate on a script and watch it redraw on every keystroke. Author once, run on any symbol or timeframe. Inputs you declare with @input directives appear in a preview pane below the editor so you can tune values live without re-opening a settings menu.

For the deep reference of the DeltaDSL language, the sandbox model, and the editor itself, see DeltaDSL — language reference and Custom Script indicator.

Open

  • Widget Picker → Custom Scripts card. Click to toggle on.
  • Docks to the right of the chart in a stack with other side-panel widgets.

Plan tier

The Custom Scripts widget is a power-user feature. The editor opens on every plan, but running a script live on the chart is gated to the Ultimate tier; on lower tiers the script compiles and runs in a sandboxed preview only. See Plans & billing for the current matrix.

Anatomy

RegionWhat it shows
HeaderScript name, dirty / saved indicator, run / pause / save controls.
EditorDeltaDSL source. Syntax-highlighted, with inline error markers and hover-help on every builtin.
Inputs paneLive preview of every @input you declare in the script — sliders, number inputs, color pickers, dropdowns. Tune values; the chart redraws in real time.
ConsoleErrors, warnings, and log() output from the running script.
FooterCompile status, plan tier badge, last-run timestamp.

Editor features

  • Syntax highlighting for DeltaDSL keywords, builtins, and @input directives.
  • Inline diagnostics — every syntax / type error is marked at the offending line.
  • Hover-help on every builtin function (ma(), rsi(), crossover(), plot(), drawArrow(), …).
  • Autocomplete for builtins and your own declared variables.
  • Multi-cursor and standard code editor keybindings (Cmd/Ctrl + D, Cmd/Ctrl + /, etc.).

Live preview

The widget recompiles on every keystroke (debounced) and pushes the new compiled program into the chart engine. Drawings and plots update live so you can:

  • Write plot(ma(close, 20)) and immediately see the moving average draw.
  • Add if rsi(14) > 80 then drawArrow(...) and instantly see arrows on the chart at overbought conditions.
  • Tune any @input value in the inputs pane and watch the chart shift.

The iteration cycle is typing → chart updates, no save-and-reload step.

@input directives

Inputs you declare in the script appear automatically in the inputs pane:

JavaScript
@input period(14, min=2, max=200, step=1, label="RSI period")
@input threshold(70, min=50, max=100, step=1, label="Overbought threshold")
@input color(#F0B90B, label="Line color")

Each @input becomes a tuned control in the inputs pane. Values are saved per-script and per-device. They are never sent to the backend — your input choices live on the device they were tuned on, like UI preferences for any other indicator.

See DeltaDSL — inputs for the full directive grammar.

Save / load / share

  • Save — the current script is persisted to your account; you can open it on any device.
  • Load — open any of your previously saved scripts from the picker.
  • Share — publish a script to your public profile or send a one-link share URL. Other users can clone it into their editor; running it still respects their plan tier.

A future Marketplace surface will let users browse public scripts; the sandboxed execution model means any cloned script is bounded by the same hard runtime caps that protect the rest of the platform.

Sandbox guarantees

DeltaDSL is a closed sandbox — a script cannot reach the network, the DOM, your local storage, or any other surface outside the chart engine. There is no fetch(), no eval(), no file access. Loop budgets and call-depth limits are enforced by the runtime so a runaway script can't lock your tab. This is the same model TradingView Pine Script uses, for the same reason: public sharing is only safe if the language is sandboxed by construction.

If you find yourself wanting an escape (e.g. fetching historical data from an external API), that's a request for a new builtin, not a runtime escape — open a feature request.

Performance

The Custom Scripts widget is heavy only when your script is heavy. A script with a single MA and one plot() is essentially free. A script with nested loops over 5000 bars, ten array allocations per bar, and a divergence check against three other timeframes will be noticeable. Watch the last-run timestamp in the footer; if it's > 50ms you're in the noticeable range — start optimizing.

Mobile

The mobile widget opens as a fullscreen sheet, but the editor is intentionally cramped on small screens. Most users author on desktop and use mobile only to toggle scripts on / off and tune @input values. We don't recommend writing new scripts on a phone.

What's next