Docs·Web App·Indicators

Custom Script (DeltaDSL host)

Drop a DeltaDSL script onto the chart and it runs as a first-class indicator — same render loop, same alert pipeline as the built-ins, written by you.

Custom Script is the wrapper that runs your own DeltaDSL scripts on the chart as if they were native indicators. The script paints into the same overlay or sub-pane the built-ins use, reads from the same OHLCV feed, and feeds the same alert builder — but the actual logic is whatever you (or a script author you trust) wrote. Useful when nothing in the catalog plots quite the way you want, or you have a private setup you don't want to share.

Custom DeltaDSL script running as a first-class chart indicator with the auto-built inputs popover open

Settings reference

The settings popover for a Custom Script is auto-built from the script source. Every @input line in the script becomes a row in the popover; the widget type is picked automatically from the declared input type. There are no fixed parameter sections — the popover reshapes itself per script. The table below lists what's always there, regardless of which script you loaded.

SectionSettingDefaultNotes
HeaderScript namefrom script's @nameDisplayed at the top of the popover so you can tell instances apart when you have several custom scripts on the same chart.
Edit codeOpens the script editor for this exact script. Save in the editor and the chart re-renders against the new source.
InputsAuto-built per scriptfrom each @input defaultOne row per @input declared in the source. The widget follows the input type — checkbox for bool, numeric stepper for int / float / price, dropdown for string / source when options= is set, color picker (with alpha) for color, free-text for any other string. Each row carries a small INT / FLOAT / BOOL / COLOR / STRING / SOURCE / PRICE tag so the type is obvious at a glance.
Min / max clampfrom @input minval / maxvalNumeric inputs respect the bounds the script author declared. The stepper refuses to push the value past them.
ExecutionRealtime calculationOffWhen on, the script recomputes on every incoming tick instead of only when a bar closes. Useful for live-fire signals where bar-close latency hurts; leave off for slow, end-of-bar structure work.

If the loaded script has no @input declarations, the popover replaces the Inputs rows with a one-line hint pointing you back at the editor with an example @input line — so the popover never looks broken when there's genuinely nothing to tune.

If the script source has errors, the popover shows a red error strip at the top with the line number and message, before the inputs block. The chart keeps the last good render in the meantime; fix the source in the editor, save, and the strip clears.

How to use it

  1. Open the Indicators dialog from the chart toolbar.
  2. Switch to the My Scripts tab — or Favorites for scripts you've starred from elsewhere, Invite-only for scripts shared privately with you.
  3. Click an existing script row to enable it on the chart, or click Create new script to open the editor with a blank canvas.
  4. In the editor, write or paste a DeltaDSL script — declare a name with @name, pick where it draws with @pane, expose tunable knobs with @input, then call drawing primitives like plotLine, plotShape or alertcondition to produce output. The chart redraws as you type. Save when the script does what you want.
  5. Each enabled script becomes a legend row on the chart. Click the cog on that row to open the per-script settings popover.
  6. Tune the @input knobs — every change applies immediately, there is no save button. The script re-runs and the chart repaints in place.
  7. Toggle Realtime calculation on if you want intra-bar updates rather than bar-close-only.
  8. Use Edit code at the top of the popover to jump back into the editor for that script.

Common pitfalls

  • Looking for a fixed settings list — there isn't one. Custom Script's popover is whatever the script's @input lines declare. Two different scripts produce two completely different popovers. If a knob you expect isn't there, check the source — somebody removed the @input for it (or never added it).
  • Changing inputs and expecting other devices to follow — knob positions are saved per device, locally. Open the same chart on your phone and it will show the script's defaults, not the values you tuned on desktop. The script source itself does sync across devices; the per-knob overrides do not.
  • Leaving Realtime calculation on for heavy scripts — recomputing on every tick is the right call for fast cross / threshold signals, but wasteful for multi-bar structure work (pivot scans, regression lines, divergence sweeps). Leave it off unless you specifically need intra-bar updates; the script will run on bar close and stay responsive.
  • Editing a live script and being confused by mid-typing errors — the chart re-runs after every save. Save half-finished code and the popover will show a red error strip until the syntax is clean again. The chart keeps the last good render in the meantime, so the view itself doesn't break.
  • Treating the legend's X button as "delete script" — it removes the script row from this chart only. The script itself stays in your My Scripts library and you can re-enable it from the Indicators dialog whenever. To delete a script permanently, use the trash icon inside the editor, not the chart legend.
  • Trying to load network data or read browser state from inside the script — DeltaDSL is a closed scripting language by design: no fetch, no window / document, no localStorage, no eval. If you need an external data source, surface it through the chart's built-in feeds or open a feature request — there is no escape hatch from the script side. See DeltaDSL pitfalls.

What's next