Trading terminal — Handbook
A guide to the Trading terminal web interface and the Pulse scripting language.
Overview
Trading terminal (trade-term) is a commercial tool for trading on crypto exchanges through a web interface: live candlestick charts with indicators, a paper (simulated) account, backtesting of strategies, and Pulse — a small, safe scripting language for writing your own indicators and strategies.
This technical preview is phase 1: paper trading only. It shows live market data from public exchange feeds (through CCXT), lets you place simulated orders and run backtests. It does not place real orders and stores no exchange API keys. Later phases add live trading, multiple concurrent trading sessions and more.
Signing in
Open the terminal's HTTPS address and sign in with your user name and password. If two-factor authentication is enabled for your account, you are asked for the six-digit code from your authenticator app. Your role decides what you can do:
| Role | Can |
|---|---|
viewer | View charts, indicators, backtests; run Pulse scripts. |
trader | Everything a viewer can, plus place paper orders and save/delete Pulse scripts. |
admin | Everything, plus manage settings and users. |
Chart
The Chart view shows live candlesticks for the selected exchange, symbol and timeframe. Add built-in indicators (EMA, RSI, MACD, Bollinger Bands) with Add indicator. The right panel shows your paper account (equity, cash, P&L) and lets a trader place a simulated market order.
Backtest
Run a built-in strategy over historical candles and see its return, buy-and-hold comparison, maximum drawdown and trade count, with entry and exit markers on the chart.
Pulse
The Pulse view is a code editor for your own indicators and strategies. As you type, the script is checked live: a green line confirms the kind (indicator or strategy), its name and how many inputs it has; a red line shows the first error. Inputs declared in the script appear as editable fields, so you can change parameters without touching the code. Press Run to evaluate the script against market data and plot the result; a strategy also produces a backtest.
Use Load script… to open a script from the standard library or your own saved scripts, save as… + Save to store the current script under your own name, and Delete to remove one of your own scripts.
Paper trades
A ledger of your simulated fills and their results (FILL, GAIN, LOSS). The Activity log at the bottom of the main screen records scans, fills and other events as they happen.
Settings & Users
Admins set the default exchange, symbol, timeframe, starting paper balance, and fee and slippage used by paper orders and backtests, and manage user accounts and roles. Every user can change their own password and set up two-factor authentication under My account.
Pulse: a first script
Every Pulse script starts with a version header and declares what it is. Here is a complete indicator that plots a 21-period EMA:
//@pulse 0
indicator("My EMA")
len = input(21, "Length")
plot(ema(close, len), "EMA")
The first line, //@pulse 0, marks the language version (currently v0). The script must then call indicator("name") or strategy("name") exactly once.
Indicators & strategies
A script is one of two kinds:
- Indicator — declared with
indicator("name"). It computes series and draws them withplot/plotsub. - Strategy — declared with
strategy("name"). In addition to plotting, it defines trade signals withentry(...)andexit(...), and can be backtested. A strategy must define at least oneentryand oneexit.
The series model
Pulse is vectorized: every value is a series — one number per candle on the chart. close is the whole series of closing prices; ema(close, 21) is a new series. A plain number like 21 is treated as a constant series. Arithmetic and functions work element by element across all candles at once.
There are no loops and no recursion. This keeps every script total (it always finishes) and safe to run on the server. You express logic by combining whole series with operators and the built-in functions.
Price variables
| Name | Meaning |
|---|---|
open high low close | The candle's open, high, low and close price. |
volume | The candle's traded volume. |
hl2 | (high + low) / 2 |
hlc3 | (high + low + close) / 3 |
ohlc4 | (open + high + low + close) / 4 |
time | The candle's open time (milliseconds since the epoch). |
bar_index, n | The candle's position, 0 for the first candle. |
pi | The constant π. |
na | "Not available" — a missing value. |
Operators & history access
Arithmetic: + - * / % (% is the remainder). Comparisons: == != < <= > >= return 1 (true) or 0 (false). Logic: and, or, not. A conditional expression is cond ? a : b.
Access an earlier value of a series with square brackets: close[1] is the previous candle's close, close[2] the one before that. Values before the start of the chart are na.
// true on the bar where price closes above the previous high
up = close > high[1]
Inputs
input(default, "Title") declares a numeric parameter. The title is optional (an automatic name is used if omitted). Inputs appear as editable fields in the Pulse view, so you can change them without editing the code; the value you enter overrides the default when the script runs.
length = input(14, "RSI length")
r = rsi(close, length)
Built-in functions
src is any series; len is a whole number (at least 1).
| Function | Result |
|---|---|
sma(src, len) | Simple moving average over the last len candles. |
ema(src, len) | Exponential moving average. |
rsi(src, len) | Relative Strength Index (0–100). |
stdev(src, len) | Rolling standard deviation. |
highest(src, len) | Highest value of the last len candles. |
lowest(src, len) | Lowest value of the last len candles. |
sum(src, len) | Rolling sum over len candles. |
change(src) | Difference from the previous candle: src - src[1]. |
crossover(a, b) | 1 on the candle where a crosses above b, else 0. |
crossunder(a, b) | 1 on the candle where a crosses below b, else 0. |
abs(x) | Absolute value. |
sign(x) | -1, 0 or 1 depending on the sign of x. |
max(a, b) | The larger of a and b (per candle). |
min(a, b) | The smaller of a and b (per candle). |
nz(x), nz(x, repl) | Replace na with 0 (or with repl). |
Plotting
plot(series, "Title") draws a series on the price chart; plotsub(series, "Title") draws it in a separate panel below (useful for oscillators like RSI). The title is optional.
indicator("Bands")
basis = sma(close, 20)
dev = 2 * stdev(close, 20)
plot(basis, "Basis")
plot(basis + dev, "Upper")
plot(basis - dev, "Lower")
Strategy signals
In a strategy, entry(cond) marks candles where a long position is opened and exit(cond) where it is closed. cond is any series treated as true/false (non-zero is true). The backtest is long/flat: it enters on an entry signal and exits on an exit signal, applying the configured fee and slippage.
strategy("EMA cross")
fast = input(12, "Fast")
slow = input(26, "Slow")
ef = ema(close, fast)
es = ema(close, slow)
entry(crossover(ef, es))
exit(crossunder(ef, es))
plot(ef, "EMA fast")
plot(es, "EMA slow")
Worked examples
RSI mean-reversion
Buy when RSI drops below a low threshold, sell when it rises above a high one.
//@pulse 0
strategy("RSI reversion")
length = input(14, "RSI length")
lo = input(30, "Buy below")
hi = input(70, "Sell above")
r = rsi(close, length)
entry(r < lo)
exit(r > hi)
plotsub(r, "RSI")
Donchian breakout
Enter when price closes above the highest high of the previous len candles.
//@pulse 0
strategy("Donchian breakout")
length = input(20, "Channel")
hh = highest(high, length)
ll = lowest(low, length)
entry(crossover(close, hh[1]))
exit(crossunder(close, ll[1]))
plot(hh, "Upper")
plot(ll, "Lower")
hh[1] (the previous candle's channel) instead of hh avoids comparing the close with a high that includes the current candle.The standard library
The trade-term-pulse package installs a read-only library of ready-made scripts you can load from Load script… and use as a starting point:
| Script | Kind | What it does |
|---|---|---|
sma | indicator | Simple moving average. |
ema | indicator | Exponential moving average. |
bollinger | indicator | Bollinger Bands (basis, upper, lower). |
rsi | indicator | Relative Strength Index in a sub-panel. |
macd | indicator | MACD line, signal and histogram. |
ema-cross | strategy | Fast/slow EMA crossover. |
sma-cross | strategy | Fast/slow SMA crossover. |
rsi-reversion | strategy | RSI mean-reversion. |
bollinger-breakout | strategy | Enter on a close above the upper band. |
donchian-breakout | strategy | Channel breakout on highest/lowest. |
Managing scripts
Scripts come from two places:
- System scripts (the standard library) in
/usr/lib/trade-term/pulse— read-only, shared by everyone. - User scripts in
/var/lib/trade-term/pulse— saved from the Pulse view with Save.
Both appear in Load script…; your own scripts are marked. If you save a script under the same name as a system one, your version takes precedence when loaded by name. You can delete your own scripts, but not the system library.
Licence
/usr/share/doc/trade-term/LICENSE.