Skip to content

Availability and special cases

The library documents the indicator functions exposed to strategy authors. A function that exists in a broader technical-analysis package is not automatically a TradeScript function. Use the names and argument forms in these pages; no import is needed.

Which indicators are included?

TradeScript currently receives a selection of 42 base indicator names, with 17 additional component functions for individual lines such as bb_upper and macd_signal. These guides cover that selection, its usable call forms and its known restrictions; a bound name is not always a usable numeric line.

The broader analysis library contains more calculations. Supertrend, Parabolic SAR, Ichimoku, T3 and many candlestick, chart-pattern and cycle functions are not currently exposed as built-in TradeScript calls. They are not missing merely because their guide has not been written: they first need supported inputs, usable outputs and strategy integration. Do not try to make them available by adding an import to your TradeScript file.

Use the function entries in this guide for the current supported forms. As more functions become available to TradeScript, their instructions and examples should appear here with the same release.

Functions with an explicit bars input

Most common functions accept a short call such as rsi(14) or atr(14). The following exposed functions currently need their input written explicitly:

Function Usable TradeScript form Topic
vwma vwma(bars, 14) Volume-weighted average
rmi rmi(bars, 14, 5) Momentum
awesome awesome(bars, 5, 34) Momentum
stc stc(bars, 23, 50, 10) Momentum
modified_stochastic modified_stochastic(bars, 14) Momentum
highest_n highest_n(bars, "high", 20) Extremes
lowest_n lowest_n(bars, "low", 20) Extremes

bars supplies the market-history input. Do not omit it from these forms.

Multiple-output containers

Some names represent several lines together. A condition needs a usable line rather than the container.

Container name Use these individual functions
bollinger_bands bb_upper, bb_mid, bb_lower
donchian_channel donchian_upper, donchian_mid, donchian_lower
keltner_channel keltner_upper, keltner_mid, keltner_lower
trix No individual TRIX/signal line is currently exposed for TradeScript conditions.

macd, adx, stochastic and aroon already select their primary line; their companion functions are explained in the topic pages. Arbitrary attribute access and selecting a container with a string key are not supported ways to extract a line in TradeScript.

Names that do not promise a supplied calculation

modified_rsi is bound but currently produces missing readings on ordinary close history because the first missing RSI value propagates through its extra smoother. Extra history does not resolve that calculation issue. Use RSI for working conditions. The exposed barssince helper also cannot reconstruct an event's history from an ordinary current Boolean comparison; see its input restriction.

The broader functions catalog also describes scores and external data fields. A recognised name only means it is known to the language; its calculation or data still has to be supplied. In particular, the catalog abbreviation mom has no standard injected binding. Use momentum(14) for absolute price change.

The examples in this indicator library describe single-instrument signal rules. In portfolio-wide calculations, functions that use bars do not all automatically select a separate OHLCV history for each instrument. Do not assume a successful single-instrument indicator expression proves a cross-sectional portfolio formula. Use the portfolio guide for supported selection shapes and verify the actual per-instrument inputs before extending one.

When a call fails or looks wrong

Symptom Check
Missing input in sma() or macd_signal() Write a numeric first period or explicit close; empty close-based calls do not select an input.
Unexpected Keltner width The second number is the ATR period; multiplier is third.
“Missing high/low/volume” The calculation needs full bars, not a single close series. Check the documented call and input fields.
A line cannot be compared or indexed Use the documented component function, or check whether the helper returns only a scalar.
Missing or unstable early readings Supply enough input history, including previous readings for crossings. Initialised values can also appear before a complete lookback.
A VWAP changes when the history window changes vwap() is cumulative over the supplied history and does not reset by session.
A constant-volume or flat market gives an extreme/zero reading Check that indicator's denominator, warmup and fallback behaviour rather than interpreting it as a fresh signal.

For syntax and diagnostic fixes, see fix a strategy error.