Working with the editor

The editor is where you write, test, and publish indicators. This page is the workflow tour — what each button does, where your code lives, and how versions and publishing work. If you want the language reference instead, jump to Scripting basics.

The Validate → Save → Apply loop

Every change you make moves through three actions, in this order:

1. Validate → 2. Save → 3. Apply

Dry-run on a sample · New version in library · Live chart + backtests

Action Hotkey What it does
Validate Ctrl/Cmd + Enter Dry-runs your indicator (init then on_bar over every bar) against a fixed EURUSD 15m sample. Renders nothing live.
Save Ctrl/Cmd + S Persists the source to your library as a new immutable version (1, 2, 3…).
Apply Ctrl/Cmd + Shift + Enter Adds the indicator to the chart you're looking at. Auto-saves first if the source has changed.

Validate runs on a sample, not your current chart

This is the single most common source of confusion: Validate uses a fixed EURUSD 15m dataset, not whatever symbol or timeframe is open in front of you. We do this deliberately — it makes validation fast and reproducible, and it catches the obvious problems (typos, shape mismatches, look-ahead errors) without burning a slow round-trip on real chart data.

The implication: if your indicator only works on, say, BTCUSD on the daily, Validate will pass and Apply may still raise at runtime when it actually meets your live data. After Validate passes, test on the chart you actually care about too. See Scripting basics for what ctx exposes each bar.

What blocks each step

  • Validate is blocked by parse failures and missing-class errors. The editor highlights the line.
  • Save is blocked by security-check failures (forbidden imports, builtins, dynamic code) and by defining a compute() method (init/on_bar is the only way to write an indicator). See Errors.
  • Apply runs the current source on the chart; it auto-saves a dirty draft first and does not require a separate prior Validate. If the look-ahead scanner finds a problem, Apply stops and points at the line — see Errors.

Editing an existing indicator

Open the library, click the indicator, and the source loads into the editor exactly as it was last saved. Any unsaved edits live in the editor only — they aren't reflected on the chart until you Apply.

Let the AI help

The AI button in the editor toolbar opens a side chat that knows the indicator you have open. Ask it to explain a block, add a parameter, or rewrite the whole thing. When it inserts code, the editor marks the buffer as AI code inserted — run Validate before you Save, exactly as you would for your own edits.

You can also ask for an indicator from scratch in AI Chat on the home page — describe what you want to see on the chart. It lands in your library like anything else you saved, and these docs are how you read and tweak what it produced.

Start from a built-in

Every built-in indicator can be used as a starting point. It's the single fastest way to learn the API:

  1. In the editor, click New from builtin.
  2. Pick something close to what you want — e.g. RSI, Bollinger Bands, MACD.
  3. A new editable draft opens, already cleaned up as a starter. Give it a name.
  4. Read the source. Tweak it. Save your version.

The built-ins are written against the same API you have. There's no privileged surface — if a built-in does it, you can do it. To branch one of your own indicators the same way, use Fork into a new indicator.

The library

There are two places you'll browse indicators:

Where Sections What's there
Editor library Mine, Built-ins Everything you've saved, and the indicators we ship (read-only, usable as starters).
Indicators button on the chart Custom Scripts, Community, Technicals Your scripts, indicators other users have published, and the built-ins grouped by category.

The search box filters whichever section you're in. The Backtest-safe only checkbox hides indicators that did not pass the look-ahead check — see Errors.

Versions

Every Save creates a new version. Versions are immutable — we never overwrite an old one. Open Version history (the clock icon next to the indicator name) to see the full list with save timestamps.

Click any version to load its source into the editor as your current draft. Nothing is deleted by doing that; when you Save again, the restored source becomes the newest version.

Publishing

Indicators are private by default. To share one, open the publish dialog from the indicator's menu and choose Publish to Community. That submits it for a quick review:

State What it means What you can do
Pending Submitted, waiting for review. Withdraw submission to pull it back.
Approved Listed under Community for every user. Make private to stop new people from finding it.
Rejected Not listed. Fix the issue and Resubmit.

Community users always see your latest saved version, so once an indicator is public, treat Save as a release: validate first.

Where to go next

Documentation