Indicators and functions¶
Use these names in conditions and calculations. Parameters count signal bars unless a function says otherwise. The catalog documents names and call shapes; the running environment must also supply the corresponding data and calculation.
For arguments, defaults, result units and working examples, open the indicator library. Start with conditions and indicators to combine calls into rules. The signatures here are for TradeScript; Python calls can differ.
Read arguments and results¶
length/lookback count bars, not calendar days. mult is a multiplier, for example the band width in bb_upper(20, 2). A price indicator such as an EMA is in price units; RSI is a 0–100 reading; ATR is a price distance. series selects the input explicitly, as in highest(high, 20). Many close-based indicators accept a period-only call such as ema(20); their full input form is ema(close, 20). These call shapes follow the current language's input convention.
Use numeric results in comparisons, Boolean predicates as conditions, and cross-sectional mappings for ranked selection. rank compares instruments at one observation; ts_rank compares one instrument over its history. They are different operations. Read definitions and portfolio selection before composing a score.
A recognised name is not a promise of supplied data. Core time/session predicates read the current bar; factor/event fields need their own inputs. Named universes, pair and option fields remain catalog entries where their TradeScript strategy shapes are unsupported.
Price and volume indicators¶
| provider | what it is · call shape |
|---|---|
adx |
Average Directional Index — trend strength (0–100), the ADX line; directional legs via plus_di/minus_di · adx(length) |
alma |
Gaussian-weighted moving average · alma(length) |
aroon |
Aroon oscillator (Aroon Up − Aroon Down, −100..100); the legs are aroon_up/aroon_down · aroon(length) |
aroon_down |
Aroon Down (0–100) — how recently the lowest low occurred · aroon_down(length) |
aroon_up |
Aroon Up (0–100) — how recently the highest high occurred · aroon_up(length) |
atr |
Average True Range, a volatility measure (used by ATR stops) · atr(length) |
awesome |
Fast minus slow midpoint averages · awesome(bars, fast_period, slow_period); defaults 5, 34 |
bb_lower |
Bollinger lower band · bb_lower(length, mult) |
bb_mid |
Bollinger middle band (the SMA) · bb_mid(length) |
bb_upper |
Bollinger upper band · bb_upper(length, mult) |
cci |
Commodity Channel Index · cci(length) |
cmf |
Chaikin Money Flow — volume-weighted accumulation/distribution · cmf(length) |
crossover |
True only on the bar the first series crosses UP through the second — the edge, not the state (write it as a crosses over b / a crosses b) · crossover(a, b) |
crossunder |
True only on the bar the first series crosses DOWN through the second — the edge, not the state (write it as a crosses under b) · crossunder(a, b) |
dema |
Double exponential moving average · dema(length) |
donchian_lower |
Donchian channel lower band — the lowest low over N bars · donchian_lower(length) |
donchian_mid |
Donchian channel midline — (upper + lower) / 2 · donchian_mid(length) |
donchian_upper |
Donchian channel upper band — the highest high over N bars · donchian_upper(length) |
ema |
Exponential moving average · ema(length) |
force_index |
Force Index — price change × volume · force_index(length) |
highest |
Highest value of a series over the last N bars · highest(series, length) |
highest_n |
Rolling high series · highest_n(bars, column, period); defaults column high, period 20 |
historical_volatility |
Annualised log-return volatility in percentage points · historical_volatility(period, observations_per_year); defaults 20, 252 |
hull_ma |
Hull moving average · hull_ma(length) |
kama |
Adaptive moving average · kama(length) |
keltner_lower |
Keltner lower price band: EMA − multiplier × ATR · keltner_lower(ema_period, atr_period, multiplier), defaults 20, 10, 2. |
keltner_mid |
Keltner EMA centre · keltner_mid(ema_period), default 20. Optional later arguments are ATR period and multiplier. |
keltner_upper |
Keltner upper price band: EMA + multiplier × ATR · keltner_upper(ema_period, atr_period, multiplier), defaults 20, 10, 2. See channels. |
lowest |
Lowest value of a series over the last N bars · lowest(series, length) |
lowest_n |
Rolling low series · lowest_n(bars, column, period); defaults column low, period 20 |
macd |
MACD line — the comparable series (fast EMA − slow EMA) · macd(fast, slow, signal) |
macd_hist |
MACD histogram (line − signal) · macd_hist(fast, slow, signal) |
macd_signal |
MACD signal line (EMA of the MACD line) · macd_signal(fast, slow, signal) |
mfi |
Money Flow Index, volume-weighted RSI · mfi(length) |
minus_di |
−DI, the negative directional indicator (ADX system) · minus_di(length) |
modified_rsi |
Extra-smoothed RSI binding; currently produces missing readings with ordinary close history, so use rsi for working conditions |
modified_stochastic |
Extra-smoothed stochastic %K · modified_stochastic(bars, length) |
mom |
Catalog name without a standard runtime binding. Use momentum(length) for absolute price change. |
obv |
On-Balance Volume · obv() |
plus_di |
+DI, the positive directional indicator (ADX system) · plus_di(length) |
ppo |
Percentage price oscillator · ppo(fast_period, slow_period); defaults 12, 26 |
rmi |
Relative Momentum Index · rmi(bars, period, momentum); defaults 14, 5 |
roc |
Rate of Change (percentage) · roc(length) |
rsi |
Relative Strength Index, a 0–100 momentum oscillator · rsi(length) |
sine_weighted_moving_average |
Sine-weighted mean · sine_weighted_moving_average(length) |
sma |
Simple moving average · sma(length) |
stc |
Schaff Trend Cycle · stc(bars, fast_period, slow_period, cycle_period); defaults 23, 50, 10 |
stddev |
Rolling standard deviation · stddev(series, length) |
stochastic |
Stochastic oscillator %K (0–100) — the primary line; %D via stochastic_d · stochastic(length) |
stochastic_d |
Stochastic %D line — the SMA of %K · stochastic_d(length) |
stochastic_k |
Stochastic %K line (0–100) · stochastic_k(length) |
tema |
Triple exponential moving average · tema(length) |
tsi |
True Strength Index · tsi(period, double_period); defaults 25, 13 |
vidya |
R²-adaptive moving average · vidya(length) |
vwma |
Volume-weighted mean of close · vwma(bars, length); explicit bars required |
williams_r |
Williams %R — a 0 to −100 momentum oscillator · williams_r(length) |
wma |
Weighted moving average · wma(length) |
zero_lag_ema |
EMA with second-EMA lag compensation · zero_lag_ema(length) |
zlema |
EMA of lag-adjusted price · zlema(length) |
Scores and calculations¶
| provider | what it is · call shape |
|---|---|
abs |
Absolute value · abs(x) |
carry |
Carry signal (e.g. FX/commodity/rates carry) · carry() |
correlation |
Rolling correlation of two series · correlation(x, y, length) |
covariance |
Rolling covariance of two series · covariance(x, y, length) |
decay_linear |
Linearly-weighted moving average (recent bars heavier) · decay_linear(x, length) |
delay |
Value of x N bars ago · delay(x, length) |
delta |
Change vs N bars ago (x − x[N]) · delta(x, length) |
funding |
Perp funding rate (crypto basis) · funding(perp) Catalog only: its TradeScript strategy shape is unsupported. |
hedge_ratio |
Pair hedge ratio (static in v1) · hedge_ratio(a, b, lookback) Catalog only: its TradeScript strategy shape is unsupported. |
indneutralize |
Demean a value within its industry/group · indneutralize(x, group) |
iv_rank |
Implied-volatility rank over a window (options) · iv_rank(length) Catalog only: its TradeScript strategy shape is unsupported. |
log |
Natural logarithm · log(x) |
max |
Element-wise / pairwise maximum · max(a, b) |
min |
Element-wise / pairwise minimum · min(a, b) |
momentum |
Momentum indicator — ABSOLUTE price change over N bars, per symbol (close[0] − close[N]) · momentum(lookback). For cross-sectional ranking use momentum_rank (this one is price-level-dominated). |
momentum_rank |
Cross-sectional momentum — ranks the universe by % return over N bars (rate-of-change, comparable across price levels); returns {symbol: score} for top_n/bottom_n · momentum_rank(series, lookback) |
product |
Rolling product over the window · product(x, length) |
quality |
Quality factor score (e.g. gross profitability) · quality() |
r_squared |
R² of a rolling linear regression · r_squared(series, length) |
rank |
Cross-sectional rank of a value across the universe (0–1) · rank(x) |
regression_slope |
Slope of a rolling linear regression · regression_slope(series, length) |
residual |
Idiosyncratic (market-/factor-residual) return signal · residual() |
scale |
Scale a vector so |weights| sum to a target · scale(x, target) |
score |
Generic composite score provider (bind your factor blend) · score() |
sign |
Sign of x (−1/0/+1) · sign(x) |
signedpower |
sign(x) · |x|^e — the WorldQuant signed power · signedpower(x, e) |
sqrt |
Square root · sqrt(x) |
sum |
Rolling sum over the window · sum(x, length) |
surprise_z |
Earnings-surprise z-score (event signal) · surprise_z() |
trend |
Trend signal (sign/strength of a moving-average system) · trend(lookback) |
ts_argmax |
Bars since the maximum over the window · ts_argmax(x, length) |
ts_argmin |
Bars since the minimum over the window · ts_argmin(x, length) |
ts_max |
Maximum over the window · ts_max(x, length) |
ts_min |
Minimum over the window · ts_min(x, length) |
ts_rank |
Time-series rank of the current value over N bars · ts_rank(x, length) |
value |
Value factor score (e.g. book-to-market) · value() |
zscore |
Standardized z-score of a series · zscore(series, length) |
Price fields and external inputs¶
| provider | what it is · call shape |
|---|---|
adv |
Average daily volume (per symbol; used by participation caps) |
bars |
Complete OHLCV history input for the current instrument · e.g. vwma(bars, 14) |
cap |
Market capitalization (per symbol) |
close |
Bar close price (series; also the flatten verb close()) |
days_to_expiry |
Days to option expiry (options scope) Catalog only: its TradeScript strategy shape is unsupported. |
futures_basket |
Named universe: a diversified futures basket Catalog only: its TradeScript strategy shape is unsupported. |
g10_fx |
Named universe: G10 FX pairs Catalog only: its TradeScript strategy shape is unsupported. |
high |
Bar high price (series) |
hl2 |
Median price (high + low) / 2 (series) |
hlc3 |
Typical price (high + low + close) / 3 (series) |
low |
Bar low price (series) |
nifty50 |
Named universe: NIFTY 50 constituents Catalog only: its TradeScript strategy shape is unsupported. |
ohlc4 |
Average price (open + high + low + close) / 4 (series) |
open |
Bar open price (series; open[0] = current bar) |
perp |
Perpetual-future leg handle (crypto basis; funding(perp)) Catalog only: its TradeScript strategy shape is unsupported. |
profit |
Open-position profit (used in exit conditions, e.g. profit > 50%) |
returns |
Per-bar return series |
sp100 |
Named universe: S&P 100 constituents Catalog only: its TradeScript strategy shape is unsupported. |
sp500 |
Named universe: S&P 500 constituents Catalog only: its TradeScript strategy shape is unsupported. |
spread |
Pair spread series (pairs scope) Catalog only: its TradeScript strategy shape is unsupported. |
volume |
Bar volume (series) |
vwap |
Volume-weighted average price |
Time and session functions¶
| provider | what it is · call shape |
|---|---|
after |
True when the current bar's time-of-day is past HH:MM · after("09:30") |
at |
True when the current bar's clock equals HH:MM · at("15:15") |
barssince |
Bars since true in a historical Boolean series; ordinary TradeScript comparisons produce only a current Boolean and cannot supply that history |
before |
True when the current bar's time-of-day is before HH:MM · before("15:00") |
change |
Current minus N-bars-ago value in input units · change(series, offset); default offset 1 |
falling |
Strict decrease on every adjacent step · falling(series, steps); default steps 1 |
mean |
Current scalar mean of up to N available values · mean(series, length) |
pct_change |
Relative change as a fraction (0.05 means 5%) · pct_change(series, offset); default offset 1 |
rising |
Strict increase on every adjacent step · rising(series, steps); default steps 1 |
session_range |
Opening-range / session-window summary anchored to the current day; None until the window closes. Fields: .high/.low/.range/.avg_volume · session_range(start, end) |
stdev |
Current scalar sample standard deviation; stddev is an alias · stdev(series, length) |