Deskr Script lets you build your own indicators on the terminal at /app/terminal: plot lines and histograms, mark signals, draw levels, test a strategy and get alerts. It's plain JavaScript run once over all bars, with the same maths as the built-in indicators.
Open the terminal and click { } (Deskr Script editor) in the top bar, or press / and pick New indicator from template.
Choose a template (Price overlay, Oscillator in a pane, Perp positioning, Signals + strategy, Levels from live data or Blank).
Edit it. The editor highlights syntax, suggests the API as you type (Ctrl+Space; type ta. for the library) and shows docs when you hover a name. Syntax errors are underlined as you type; a run-time error is shown on its line.
Run (Ctrl+Enter). The output appears on the chart.
Name it and click Add to chart. It's saved to My indicators (on your account when signed in, in this browser otherwise) and drawn on every chart like a built-in.
js
// Oscillator in its own pane, with guides and an alertconst len = input("Length", 14, { min: 2, max: 100 });const r = ta.rsi(close, len);plot(r, { title: "RSI " + len, pane: "osc", color: "#b48cff" });hline(30, { pane: "osc" }); hline(70, { pane: "osc" });alertcondition(ta.crossover(r, 30), "Back above 30");
Add alertcondition(cond, "title") — cond is a series of booleans (true on the bars where it fires) or one boolean for the last bar. After Run, the Alert conditions list in the Output tab shows each one; click Alert me · once or every time. Deskr checks it on every closed bar of that coin and timeframe and notifies you in the app (bell + Rules & alerts). Free: 2 script alerts, Pro: 20.
The live snapshot (zones, levels, walls, liqs, options) is null when alerts are evaluated, as in the Strategy Tester — there is no history of it, so alerts can't depend on it.
Click Share to create a read-only link (deskr.trade/script/…) with the source. Anyone with the link can read it and open it in their terminal to keep a copy. Sharing is opt-in per script; your name is shown only if you tick Show my name. A public library with ranking comes later.
In your browser, scripts run in a sandboxed iframe with no network and no access to the page, in a fresh worker per run, stopped after 3 s.
Script alerts run on Deskr's server in a separate worker process — never in the web app or the data engine — with Node's permission model on (no file writes, no child processes), an empty environment, a fresh JavaScript context per run with no host objects, a 1 s run limit, a 64 MB heap and a hard kill after 3 s.
Scripts are capped at 20,000 characters; up to 20 plots, 20 guides, 200 levels, 500 markers and 10 alert conditions per run.
Confirmed possible patterns: patterns.find({ kind, cat, dir, minQ }), patterns.at(i), patterns.all. cat is chart | harmonic | candle | smc | perp; kind is one id or a list. Each result has .at (the bar whose close confirmed it), .dir, .q, .target, .stop, .name. Outcome fields are omitted so a script cannot peek.
strategy.long(i, {sl, tp}), strategy.short(i, …) and strategy.close(i) place orders that the Test strategy tab simulates honestly: signals are found by re-running the script on every bar as it closed, fills are at the next bar's open, with taker fees, funding, stops before targets and liquidation. A repaint check reports signals that change once later bars arrive.