TradingCharts

Publishing

A script becomes usable to someone else — including yourself on a different chart — only after it is published. Publishing an indicator or strategy stores a version on the server and…

From the editor

  1. Write the script.
  2. Click ▷ Add to chart (indicator / strategy) or ▷ Publish library.
  3. If this is the first save, pick a name and visibility.
  4. The compiler runs server-side; a successful compile creates version v1.
  5. Each subsequent save bumps the version — v1 → v2 → v3.

Versions are immutable. You cannot rewrite v1; the next save becomes v2. Consumers pin a specific version (import you/MyMa/1 as m), so an update never silently reaches them.

Visibility

  • Private (default) — only you can see, add, or import it.
  • Unlisted — anyone with the link / id can add or import it; it does not appear in listings.
  • Public — listed in the Indicators hub for all users.

Visibility is per script (all versions) and can be changed any time from the editor's visibility dialog.

For libraries, the publish flow surfaces the canonical import path and copies it to your clipboard:

import <ownerId>/<Name>/<version> as <Alias>

Naming rules

Script kind Name rule
Indicator / strategy Anything up to 100 characters.
Library [A-Za-z0-9_]+ only — library names ride import paths.

The editor sanitises a library name that breaks this rule before saving (and says so in the Logs panel); the server rejects an unsafe name outright.

Protected scripts

A protected script publishes the compiled artifact but hides the source — users can add it to a chart and configure its inputs, but they cannot read or fork the code (Protected scripts cannot be forked). A protected library can still be imported by anyone the visibility allows: the compiler resolves it server-side and the source never reaches the importer.

Marketplace listing

Public scripts appear in the Indicators hub, filtered by kind (indicator / strategy / library). Marketplace listings additionally carry the creator's catalogue data: title, description, preview image, and the plan (free, or paid with monthly / yearly prices). Adding a paid script to a chart requires an active plan — without one the add is refused with SUBSCRIPTION_REQUIRED and a link to the listing.

If the plan expires while the script is on a chart, the stream is ended within ten minutes (exactly at the plan end when the end time is known): the indicator shows SUBSCRIPTION_EXPIRED: your subscription to this indicator has ended — renew it to keep using it, stops updating, and any alert rules on it are deactivated. After renewing, re-add the script to the chart and re-enable the alerts.

A user can have at most 5 custom + community scripts on a chart at a time; built-in indicators are not counted.

Alerts and distribution

A publicly-published strategy with alert_message= on orders can be armed by any user as a durable trigger = order_fill alert — fills reach their configured webhook / push without the script owner needing to run anything. See Alerts.

Updating a published script

Saving a new version does not touch charts that already run an older one. "Add to chart" from the hub always adds the latest version; a chart that has the script open is told about the new contract and can refresh to it. Deleting a script hides it from listings and stops new adds; executions already running finish their session.

Credit and licensing

  • Include a top-of-script header comment with your name and licence.
  • Published code may be reused personally, but public re-publication needs the author's explicit permission — crediting the original author in both the code and the publication description is expected.

Checklist before publishing

  • Script compiles with no warnings beyond the deliberately-ignored ones.
  • All inputs have a title= and a tooltip= where behaviour isn't obvious.
  • All plots have a title= and sensible color=.
  • A header comment describing what the script does and how to read it.
  • Default inputs produce something recognisable on an un-configured chart.
  • For strategies: a sensible initial_capital and commission model — the Strategy Tester report is only useful if these are honest.

See also