Getting started

PulseScript runs inside the terminal — there is nothing to install. Every code block on these pages has a Run in terminal button that opens the editor with the script loaded.

1 · Open the Script dock

Go to the terminal and press Script in the top bar. A docked editor opens under the chart with a sample strategy: press Run and its plots and buy/sell marks land on the live candles of the active pane.

2 · Your first script

Replace the editor contents with this — the smallest useful study:

PulseScript
pulse 1
meta(name: "My first study", overlay: true)

# A 20-bar average of the close — one line, no boilerplate.
smooth = sma(close, 20)
draw line(smooth, color: "#7c9cff", title: "SMA 20")

Line by line: pulse 1 declares the language version. meta(…) names the study. smooth = sma(close, 20) computes a 20-bar average of the close on every bar — assignments are per-bar series, not single values. draw line(…) puts it on the chart.

3 · Make it tunable

input.* declarations become real controls in the editor’s Inputs panel — change a value and the script re-runs instantly:

PulseScript
pulse 1
meta(name: "Tunable RSI gate", overlay: true)

len = input.num(14, "RSI length", 2, 50)
floor = input.num(30, "Oversold level", 5, 50)

when rsi(close, len) < floor: mark buy at low "oversold"

4 · Save it, then use it everywhere

  • Save in the dock header stores the script to your account.
  • Backtest trades the script’s buy/sell marks over the last 1000 real candles — win rate, drawdown, equity curve, per-trade list.
  • Optimizer sweeps your input.num ranges MetaTrader-style and ranks the results honestly.
  • The Scanner’s Script mode runs a saved script across every symbol in the catalog — a symbol matches when your script signals on its last closed bar.

Next: the language tour covers everything — history reads, state, control flow, functions, and multi-timeframe.