Expression Schema — Detailed JSON Reference

Per-type schema for every element type available on this SaaS. Use this when generating expression JSON with an AI assistant. SaaS-forbidden types (Lua, C++ operands, account/position metrics) are omitted — see nlp-help §15. For the higher-level NLP path see nlp-help.html.

Contents
  1. Base Fields (every expression)
  2. Common Optional Keys
  3. Operators (binary + logical)
  4. TA_Indicators
  5. TA_CandlePatterns
  6. CandlePatterns
  7. OHLC_Bar / HeikinAshiBar / RenkoBar / TickRevBar / FibonnaciBar
  8. Quotes
  9. TrendObject
  10. ChannelObject
  11. PivotObject
  12. PricePattern / PricePatterns
  13. ABCPattern
  14. PriceMoveObject
  15. DateValue / HourValue / SideValue
  16. UserExpression (composition)
  17. Fundamental
  18. Reducers / History / Series
  19. Unary Modifiers (Not / Sqrt / Pow / Abs)
  20. Repeat Conditions / Time Limit
  21. Implementation Notes & Gotchas
  22. Full Catalogs (every selectable value)

1. Base Fields (every expression)

Each expression has a left side, a comparison operator, and a right side. Field names use the prefix Expression_left_ or Expression_right_. Plus expression-level fields (ExpressionName, Symbols, etc.).

{
  "ExpressionName": "unique_name_within_account",    // required, unique
  "Expression_left_Name": "descriptive_label_for_left",
  "Expression_left_ElementType": "<one of the type IDs listed below>",
  "Expression_left_ElementValue": "<type-specific value>",
  "Expression_left_operation": "<",                  // see §3 Operators
  "Expression_right_ElementType": "FixedVal",
  "Expression_right_ElementValue": "30",
  "Expression_right_Name": "descriptive_label_for_right",
  "Symbols": ["EURUSD"],                            // exactly ONE symbol per expression
  "tags": ["alert"]                                // "alert" | "helper"
}
Required minimum: ExpressionName, Expression_left_ElementType, Expression_left_operation, Expression_right_ElementType. Every other field is optional but most types need at least ElementValue + Frame.

2. Common Optional Keys

These keys can appear on either side when configured. Most are mutually exclusive or only meaningful for certain element types — see the per-type sections for which apply.

{
  "Expression_left_UseCurrentObject": true,
  "Expression_left_Index": 1,
  "Expression_left_TickRevVal": 50,
  "Expression_left_WaveName": "A",
  "Expression_left_repeatMinXbars": 2,            // see §22 Repeat
  "Expression_left_repeatMaxXbars": 5,
  "Expression_left_repeatMinMaxXbarsFrame": "M5",
  "Expression_left_TimeLimitInSeconds": 60,
  "Expression_left_useTotalSum": true,             // see §20 Reducers
  "Expression_left_UseMA": true,
  "Expression_left_UseEMA": true,
  "Expression_left_UseSD": true,
  "Expression_left_UseStandardDev": true,
  "Expression_left_UseMeanDev": true,
  "Expression_left_UseHistoryElem": true,
  "Expression_left_historyIndex": 3,
  "Expression_left_collectionSize": 4,
  "Expression_left_numElement": 4,
  "Expression_left_applyUnaryNot": true,            // see §21 Unary
  "Expression_left_applySqrt": true,
  "Expression_left_applyPow": true,
  "Expression_left_applyAbs": true
}

3. Operators (binary + logical)

OperatorJSON valueUsed betweenNotes
less than"<"numeric · numerice.g. RSI < 30
greater than">"numeric · numeric
equal"="numeric · numeric · boolean
not equal"!="numeric · numeric · boolean
less or equal"<="numeric · numeric
greater or equal">="numeric · numeric
logical AND"AND"boolean · booleanboth sides must be boolean (UserExpression refs or pattern fires)
logical OR"OR"boolean · boolean
cross above">" + cross flagnumeric · numericNLP shortcut "crosses above" — emit as > with cross direction tracking
cross below"<" + cross flagnumeric · numericNLP shortcut "crosses below"
Combining expressions: use AND / OR between two UserExpression references to build deeper trees. No depth limit — see §16.

4. TA_Indicators

200+ technical indicators (RSI, SMA, EMA, MACD, BBANDS, ATR, STOCH, ADX, ICHIMOKU, …). Param fields use Size1, Size2, Size3, and Double1/Double2/Double3 for floating-point params (ALMA offset/sigma, JMA phase, etc.).

{
  "ExpressionName": "RSI_Oversold_5m_EURUSD",
  "Expression_left_ElementType": "TA_Indicators",
  "Expression_left_ElementValue": "RSI",                // indicator name (uppercase canonical)
  "Expression_left_Name": "RSI_Oversold_5m_EURUSD",
  "Expression_left_Frame": "5Min",                    // see §24.6 Timeframes
  "Expression_left_Size1": 14,                        // first numeric param (RSI period)
  "Expression_left_operation": "<",
  "Expression_right_ElementType": "FixedVal",
  "Expression_right_ElementValue": "30",
  "Expression_right_Name": "RSI_Oversold_5m_EURUSD",
  "Symbols": ["EURUSD"],
  "tags": ["alert"]
}

Optional fields for multi-param indicators: Size2, Size3, Double1 (e.g. ALMA offset), Double2 (e.g. ALMA sigma), Subfield (MACD→Signal/Macd/Hist, BBANDS→Upper Band/Middle Band/Lower Band, STOCH→SlowK/SlowD, ICHIMOKU→Tenkan/Kijun/Senkou A/Senkou B/Chikou, etc. — see INDICATOR_SUBFIELDS at /api/builder/schema.js).

Timeframes

Valid Frame values: "1Min", "2Min", "5Min", "15Min", "30Min", "1Hour", "4Hour", "Daily", "Weekly".

Indicator default params & labels

The complete list of 232 indicator default-params and 179 param labels is served live at /api/builder/schema.js — fields DEFAULT_PARAMS and INDICATOR_PARAM_LABELS. Examples:

IndicatorSize1Size2Size3Double1Double2Notes
RSI14 (Period)Common: 14 = period
SMA30 (Size)Common: 20, 50, 100, 200
EMA30 (Size)
MACD12 (Fast)26 (Slow)9 (Signal)Subfields: Macd / Signal / Hist
BBANDS20 (Period)2 (StdDev)Subfields: Upper Band / Middle Band / Lower Band
STOCH1433Subfields: SlowK / SlowD
ATR14
ADX14
ALMA10 (Length)0.85 (Offset)6 (Sigma)
KC (Keltner Channel)202 (Mult)Subfields: Lower / Basis / Upper
DONCHIAN20Subfields: Lower / Mid / Upper
ICHIMOKU92652Subfields: Tenkan / Kijun / Senkou A / Senkou B / Chikou
AROON14Subfields: Aroon Up / Aroon Down
VWMACDSubfields: VWMACD / Signal / Histogram

For indicators not listed above, fetch the live schema and look up the indicator in DEFAULT_PARAMS / INDICATOR_PARAM_LABELS / INDICATOR_SUBFIELDS.

5. TA_CandlePatterns

{
  "ExpressionName": "Hammer_15m_Bullish_EURUSD",
  "Expression_left_ElementType": "TA_CandlePatterns",
  "Expression_left_ElementValue": "HAMMER",            // uppercase canonical, see §24.2
  "Expression_left_Name": "Hammer_15m_Bullish_EURUSD",
  "Expression_left_Frame": "15Min",
  "Expression_left_Trend": "Bullish",                 // "Bullish" | "Bearish" — optional trend filter
  "Expression_left_operation": "=",
  "Expression_right_ElementType": "FixedVal",
  "Expression_right_ElementValue": "1",                   // 1 = pattern fired
  "Expression_right_Name": "Hammer_15m_Bullish_EURUSD",
  "Symbols": ["EURUSD"],
  "tags": ["alert"]
}

61 patterns total: DOJI, HAMMER, ENGULFING, MORNINGSTAR, EVENINGSTAR, THREEBLACKCROWS, THREEWHITESOLDIERS, SHOOTINGSTAR, INVERTEDHAMMER, PIERCING, DARKCLOUDCOVER, HARAMI, ABANDONEDBABY, etc. Full list at CANDLE_PATTERNS in /api/builder/schema.js.

6. CandlePatterns (legacy alias)

{
  "ExpressionName": "TwoCrows_Daily_Bearish_BTC",
  "Expression_left_ElementType": "CandlePatterns",
  "Expression_left_ElementValue": "TWO_CROWS",
  "Expression_left_Name": "TwoCrows_Daily_Bearish_BTC",
  "Expression_left_Frame": "Daily",
  "Expression_left_Trend": "Bearish",
  "Expression_left_operation": "=",
  "Expression_right_ElementType": "FixedVal",
  "Expression_right_ElementValue": "1",
  "Expression_right_Name": "TwoCrows_Daily_Bearish_BTC",
  "Symbols": ["BTCUSDT"],
  "tags": ["alert"]
}
Prefer TA_CandlePatterns over CandlePatterns when generating new expressions.

7. OHLC_Bar / HeikinAshiBar / RenkoBar / TickRevBar / FibonnaciBar

Bar-data accessors. ElementValue is the field within the bar — e.g. CLOSE_PRICE, HIGH_PRICE, VOLUME.

OHLC_Bar

{
  "ExpressionName": "Close_above_100_5m_EURUSD",
  "Expression_left_ElementType": "OHLC_Bar",
  "Expression_left_ElementValue": "CLOSE_PRICE",         // OHLC_FIELDS — see §24.5
  "Expression_left_Name": "Close_above_100_5m_EURUSD",
  "Expression_left_Frame": "5Min",
  "Expression_left_useOpenBar": true,                 // optional: include the current incomplete bar
  "Expression_left_operation": ">",
  "Expression_right_ElementType": "FixedVal",
  "Expression_right_ElementValue": "100",
  "Expression_right_Name": "Close_above_100_5m_EURUSD",
  "Symbols": ["EURUSD"],
  "tags": ["alert"]
}

HeikinAshiBar

{
  "ExpressionName": "HA_Close_above_100_5m_EURUSD",
  "Expression_left_ElementType": "HeikinAshiBar",
  "Expression_left_ElementValue": "CLOSE_PRICE",
  "Expression_left_Name": "HA_Close_above_100_5m_EURUSD",
  "Expression_left_Frame": "5Min",
  "Expression_left_frameIn": "5Min",                   // optional: source frame
  "Expression_left_operation": ">",
  "Expression_right_ElementType": "FixedVal",
  "Expression_right_ElementValue": "100",
  "Expression_right_Name": "HA_Close_above_100_5m_EURUSD",
  "Symbols": ["EURUSD"],
  "tags": ["alert"]
}

HEIKIN_ASHI_FIELDS: OPEN_PRICE, HIGH_PRICE, LOW_PRICE, CLOSE_PRICE, plus HA-specific aggregates.

RenkoBar

{
  "ExpressionName": "Renko_Close_above_50_5m_EURUSD",
  "Expression_left_ElementType": "RenkoBar",
  "Expression_left_ElementValue": "CLOSE_PRICE",
  "Expression_left_Name": "Renko_Close_above_50_5m_EURUSD",
  "Expression_left_Frame": "5Min",
  "Expression_left_boxsize": 10,                     // required: brick size in ticks/points
  "Expression_left_frameIn": "5Min",
  "Expression_left_operation": ">",
  "Expression_right_ElementType": "FixedVal",
  "Expression_right_ElementValue": "50",
  "Expression_right_Name": "Renko_Close_above_50_5m_EURUSD",
  "Symbols": ["EURUSD"],
  "tags": ["alert"]
}

TickRevBar

{
  "ExpressionName": "TickRev_Up_5m_EURUSD",
  "Expression_left_ElementType": "TickRevBar",
  "Expression_left_ElementValue": "TickRevEvent",        // TICKREV_FIELDS — see §24.5
  "Expression_left_Name": "TickRev_Up_5m_EURUSD",
  "Expression_left_Frame": "5Min",
  "Expression_left_TickRevVal": 50,
  "Expression_left_TickRevDirection": "Up",            // "Up" | "Down"
  "Expression_left_TickRevMinLenAB": 5,
  "Expression_left_operation": "=",
  "Expression_right_ElementType": "FixedVal",
  "Expression_right_ElementValue": "1",
  "Expression_right_Name": "TickRev_Up_5m_EURUSD",
  "Symbols": ["EURUSD"],
  "tags": ["alert"]
}

FibonnaciBar

{
  "ExpressionName": "Fibo_RatioEvent_5m_EURUSD",
  "Expression_left_ElementType": "FibonnaciBar",           // note: schema typo "Fibonnaci"
  "Expression_left_ElementValue": "TickRevRatioEvent",    // FIBO_FIELDS — see §24.5
  "Expression_left_Name": "Fibo_RatioEvent_5m_EURUSD",
  "Expression_left_Frame": "5Min",
  "Expression_left_TickRevVal": 50,
  "Expression_left_TickRevRatio": 30,
  "Expression_left_operation": "=",
  "Expression_right_ElementType": "FixedVal",
  "Expression_right_ElementValue": "1",
  "Expression_right_Name": "Fibo_RatioEvent_5m_EURUSD",
  "Symbols": ["EURUSD"],
  "tags": ["alert"]
}

8. Quotes

{
  "ExpressionName": "Spread_below_3_EURUSD",
  "Expression_left_ElementType": "Quotes",
  "Expression_left_ElementValue": "SpreadInTicks",        // QUOTES_FIELDS — see §24.5
  "Expression_left_Name": "Spread_below_3_EURUSD",
  "Expression_left_operation": "<",
  "Expression_right_ElementType": "FixedVal",
  "Expression_right_ElementValue": "3",
  "Expression_right_Name": "Spread_below_3_EURUSD",
  "Symbols": ["EURUSD"],
  "tags": ["alert"]
}

No Frame — Quotes are live tick-level fields, not bar-aggregated.

9. TrendObject

{
  "ExpressionName": "Trend_Up_5m_EURUSD",
  "Expression_left_ElementType": "TrendObject",
  "Expression_left_ElementValue": "TrendSide",            // TREND_FIELDS — see §24.5
  "Expression_left_Name": "Trend_Up_5m_EURUSD",
  "Expression_left_SlowSize": 50,
  "Expression_left_FastSize": 20,
  "Expression_left_TrendMinLen": 10,
  "Expression_left_TrendMinDuration": 30,
  "Expression_left_TrendDiffEMAs": 2,
  "Expression_left_Period": "5Min",
  "Expression_left_operation": "=",
  "Expression_right_ElementType": "FixedVal",
  "Expression_right_ElementValue": "1",                   // 1 = uptrend, -1 = downtrend, 0 = no trend
  "Expression_right_Name": "Trend_Up_5m_EURUSD",
  "Symbols": ["EURUSD"],
  "tags": ["alert"]
}

18 fields total — see TREND_FIELDS in live schema.

10. ChannelObject

{
  "ExpressionName": "Channel_Upper_breakout_EURUSD",
  "Expression_left_ElementType": "ChannelObject",
  "Expression_left_ElementValue": "UpperChannel",          // CHANNEL_FIELDS — see §24.5
  "Expression_left_Name": "Channel_Upper_breakout_EURUSD",
  "Expression_left_MinChannelWidth": 10,
  "Expression_left_ChannelDoneTicks": 5,
  "Expression_left_operation": ">",
  "Expression_right_ElementType": "FixedVal",
  "Expression_right_ElementValue": "100",
  "Expression_right_Name": "Channel_Upper_breakout_EURUSD",
  "Symbols": ["EURUSD"],
  "tags": ["alert"]
}

11. PivotObject

{
  "ExpressionName": "Pivot_above_PP_1h_EURUSD",
  "Expression_left_ElementType": "PivotObject",
  "Expression_left_ElementValue": "Pivot Point",           // PIVOT_FIELDS — note spaces in "Pivot Point", "Support 1", etc.
  "Expression_left_Name": "Pivot_above_PP_1h_EURUSD",
  "Expression_left_MonitoredFrame": "1Hour",
  "Expression_left_operation": ">",
  "Expression_right_ElementType": "FixedVal",
  "Expression_right_ElementValue": "100",
  "Expression_right_Name": "Pivot_above_PP_1h_EURUSD",
  "Symbols": ["EURUSD"],
  "tags": ["alert"]
}

12. PricePattern / PricePatterns

Two related types. PricePattern is the standalone form. PricePatterns (plural) is the legacy form that the serializer rewrites to UserExpression on the wire — see §23.

PricePattern (preferred)

{
  "ExpressionName": "DoubleBottom_5m_EURUSD",
  "Expression_left_ElementType": "PricePattern",
  "Expression_left_ElementValue": "DoubleBottom",         // all 46 patterns in §24.3
  "Expression_left_Name": "DoubleBottom_5m_EURUSD",
  "Expression_left_FieldName": "OnFormation",           // PRICE_PATTERN_FIELDS — see §24.4
  "Expression_left_Frame": "5Min",
  "Expression_left_TickRevVal": 50,
  "Expression_left_LegIndex": 1,
  "Expression_left_operation": "=",
  "Expression_right_ElementType": "FixedVal",
  "Expression_right_ElementValue": "1",
  "Expression_right_Name": "DoubleBottom_5m_EURUSD",
  "Symbols": ["EURUSD"],
  "tags": ["alert"]
}

PricePatterns (legacy, rewrites to UserExpression)

{
  "Expression_left_ElementType": "UserExpression",          // rewritten by the serializer
  "Expression_left_ElementValue": "DOUBLE_BOTTOM_50ticks_FINAL",  // rewritten: <pattern>_<TickRevVal>ticks_FINAL
  "Expression_left_TickRevVal": 50
}

13. ABCPattern

{
  "ExpressionName": "ABC_Distance_above_10_EURUSD",
  "Expression_left_ElementType": "ABCPattern",
  "Expression_left_ElementValue": "Distance",              // ABC_FIELDS — see §24.5
  "Expression_left_Name": "ABC_Distance_above_10_EURUSD",
  "Expression_left_NumElements": "3",                   // ABCPattern is the ONLY type that emits NumElements
  "Expression_left_TickRevVal": 50,
  "Expression_left_WaveName": "A",                      // ABC_WAVES: Current, AB, BC, CD, ...
  "Expression_left_operation": ">",
  "Expression_right_ElementType": "FixedVal",
  "Expression_right_ElementValue": "10",
  "Expression_right_Name": "ABC_Distance_above_10_EURUSD",
  "Symbols": ["EURUSD"],
  "tags": ["alert"]
}

14. PriceMoveObject

Subscribes to price-move events fired by another saved expression. Required: priceMoveSourceUserExp must name a saved UserExpression. The serializer rewrites the wire format to UserExpression.

{
  "ExpressionName": "PriceMove_Bid_100_Up_EURUSD",
  "Expression_left_ElementType": "UserExpression",          // rewritten by serializer
  "Expression_left_ElementValue": "MY_SOURCE_USER_EXPRESSION", // must be a saved UserExpression name
  "Expression_left_Name": "PriceMove_Bid_100_Up_EURUSD",
  "Expression_left_FieldName": "Bid",                   // PRICE_MOVE_FIELDS — see §24.5
  "Expression_left_PriceMoveValue": 100,
  "Expression_left_PriceMoveDirection": "Up",
  "Expression_left_TimeLimitSeconds": 60,
  "Expression_left_operation": "=",
  "Expression_right_ElementType": "FixedVal",
  "Expression_right_ElementValue": "1",
  "Expression_right_Name": "PriceMove_Bid_100_Up_EURUSD",
  "Symbols": ["EURUSD"],
  "tags": ["alert"]
}

15. DateValue / HourValue / SideValue

DateValue

{
  "ExpressionName": "DayOfWeek_eq_3_BTC",
  "Expression_left_ElementType": "DateValue",
  "Expression_left_ElementValue": "DayOfWeek",             // DATE_VALUES: CurrentSysDateTime, CurrentSysDay, CurrentSysTime, DayOfWeek
  "Expression_left_Name": "DayOfWeek_eq_3_BTC",
  "Expression_left_operation": "=",
  "Expression_right_ElementType": "FixedVal",
  "Expression_right_ElementValue": "3",                   // 3 = Wednesday (Sun=0..Sat=6)
  "Expression_right_Name": "DayOfWeek_eq_3_BTC",
  "Symbols": ["BTCUSDT"],
  "tags": ["alert"]
}

HourValue

{
  "ExpressionName": "AfterHour_14_EURUSD",
  "Expression_left_ElementType": "DateValue",
  "Expression_left_ElementValue": "CurrentSysTime",
  "Expression_left_Name": "AfterHour_14_EURUSD",
  "Expression_left_operation": ">=",
  "Expression_right_ElementType": "HourValue",
  "Expression_right_ElementValue": "14:00",                // HOUR_VALUES: "00:00" .. "24:00" (25 hourly slots)
  "Expression_right_Name": "AfterHour_14_EURUSD",
  "Symbols": ["EURUSD"],
  "tags": ["alert"]
}

SideValue

{
  "ExpressionName": "Side_eq_BID_EURUSD",
  "Expression_left_ElementType": "SideValue",
  "Expression_left_ElementValue": "BID",                    // SIDE_VALUES: "BID", "ASK", "NO SIDE"
  "Expression_left_Name": "Side_eq_BID_EURUSD",
  "Expression_left_operation": "=",
  "Expression_right_ElementType": "FixedVal",
  "Expression_right_ElementValue": "1",
  "Expression_right_Name": "Side_eq_BID_EURUSD",
  "Symbols": ["EURUSD"],
  "tags": ["alert"]
}

16. UserExpression (composition / reuse)

Reference another saved expression by name. This is how you compose deep trees. No depth limit.

{
  "ExpressionName": "Buy_Signal_Combined_EURUSD",
  "Expression_left_ElementType": "UserExpression",
  "Expression_left_ElementValue": "RSI_Oversold_5m_EURUSD",  // must be a saved expression's unique name
  "Expression_left_Name": "Buy_Signal_Combined_EURUSD",
  "Expression_left_ApplyChart": true,                  // optional: render on chart
  "Expression_left_UseLineChart": true,                 // optional: line-chart variant
  "Expression_left_operation": "AND",
  "Expression_right_ElementType": "UserExpression",
  "Expression_right_ElementValue": "Trend_Up_Daily_EURUSD",
  "Expression_right_Name": "Buy_Signal_Combined_EURUSD",
  "Symbols": ["EURUSD"],
  "tags": ["alert"]
}

Variant — render in sub-chart pane:

{
  "Expression_left_ApplyChart": true,
  "Expression_left_UseSubChart": true
}
Composition example — 3-level tree:
helper "Trend_Up_Daily" = SMA(50) > SMA(200) on Daily
helper "RSI_Oversold_5m" = RSI(14) < 30 on 5Min
helper "Trend_AND_Oversold" = UserExpression("Trend_Up_Daily") AND UserExpression("RSI_Oversold_5m")
alert  "Buy_Signal" = UserExpression("Trend_AND_Oversold") = true
Each layer is a saved expression. The final alert references a helper that references two more helpers. Trees can be dozens of levels deep.

17. Fundamental

{
  "ExpressionName": "PE_Ratio_above_30_AAPL",
  "Expression_left_ElementType": "Fundamental",
  "Expression_left_ElementValue": "PE_RATIO",              // FUNDAMENTAL_FIELDS — see §24.5 (87 fields)
  "Expression_left_Name": "PE_Ratio_above_30_AAPL",
  "Expression_left_FieldName": "PE_RATIO",
  "Expression_left_ReportYear": 2024,                   // emitted when fundamentalFieldYear != 0
  "Expression_left_operation": ">",
  "Expression_right_ElementType": "FixedVal",
  "Expression_right_ElementValue": "30",
  "Expression_right_Name": "PE_Ratio_above_30_AAPL",
  "Symbols": ["AAPL"],
  "tags": ["alert"]
}

Alternative — use the bar's quote-date instead of a fixed year:

{
  "Expression_left_UseQuoteDate": true
}

20. Reducers / History / Series

Wrap any side with a reducer to compute aggregates over a lookback window. Multiple flags can stack — they correspond to the modifier layer in the builder UI.

Moving Average

{
  "Expression_left_UseMA": true,
  "Expression_left_numElement": 20                       // window size
}

EMA / TotalSum / StandardDev / MeanDev / MinSeries

{
  "Expression_left_UseEMA": true,                        // or UseTotalSum, UseStandardDev, UseMeanDev, UseMinSeries
  "Expression_left_collectionSize": 20,                  // window size (some flags use this)
  "Expression_left_numElement": 20                       // window size (others use this — see notes)
}

Standard Deviation Flags

{
  "Expression_left_UseSD": true,                         // emit BOTH for standard deviation
  "Expression_left_UseStandardDev": true
}
Both flags are required for standard deviation — emit UseSD AND UseStandardDev together.

History Element (index into past values)

{
  "Expression_left_UseHistoryElem": true,
  "Expression_left_historyIndex": 3,                   // 0 = current, 1 = previous bar, etc.
  "Expression_left_collectionSize": 4                   // lookback depth
}

Max / Min Series

{
  "Expression_left_UseMaxSeries": true,
  "Expression_left_UseSeriesLocation": true             // optional: return bar index of the max
}
{
  "Expression_left_UseMinSeries": true,
  "Expression_left_UseSeriesDate": true                 // optional: return date of the min
}
{
  "Expression_left_UseNextMinMax": 1                       // numeric: 0=disabled, 1=next, 2=after-next, ...
}

21. Unary Modifiers

Wrap any side with a unary operator. Applied after the operand is resolved, before the comparison.

{
  "Expression_left_applyUnaryNot": true,                  // boolean negation: !value
  "Expression_left_applySqrt": true,                      // sqrt(value)
  "Expression_left_applyPow": true,                       // value^2
  "Expression_left_applyAbs": true                        // abs(value)
}

22. Repeat Conditions / Time Limit

Require the condition to hold for a window of bars before firing — stronger confirmation, fewer false signals.

{
  "Expression_left_repeatMinXbars": 2,                   // must be true for at least N bars
  "Expression_left_repeatMaxXbars": 5,                   // at most M bars (window)
  "Expression_left_repeatMinMaxXbarsFrame": "5Min",        // the bar timeframe to count on
  "Expression_left_TimeLimitInSeconds": 60                // alternative: time-window in seconds
}

23. Implementation Notes & Gotchas

Hidden / do not emit embedded custom-code types: EmbeddedCustomCodeOperand, CustomizedUserOperand. Lua and account / position operands are available via JSON import where supported by the runtime. See nlp-help §15.

24. Full Catalogs (every selectable value)

Authoritative enumeration of every value you can put in ElementValue for the pattern/indicator types. Sourced from the live /api/builder/schema.js endpoint — AIs that can fetch URLs should curl that endpoint for the source of truth; the static lists below are mirrored for offline reading.

24.1 TA_Indicators — 233 indicators across 14 categories

Use the indicator name (case as shown) as Expression_*_ElementValue. For per-indicator defaults (Size1, Size2, Double1, etc.) and labels, fetch DEFAULT_PARAMS + INDICATOR_PARAM_LABELS from the schema endpoint. For multi-output indicators (MACD, BBANDS, STOCH, ICHIMOKU, AROON, KC, DONCHIAN, …) the available subfield names are in INDICATOR_SUBFIELDS.

Overlap / Moving Avg (29)

ALMA, DEMA, EMA, FWMA, HILO, HMA, HWC, JMA, KAMA, MCGD, MIDPOINT, MIDPRICE, PWMA, RAINBOW, RMA, SINWMA, SMA, SSMA, SUPERTREND, SWMA, T3, TEMA, TRIMA, VIDYA, VWAP, VWMA, WCP, WMA, ZLMA

Momentum (46)

AO, APO, BIAS, BOP, BRAR, CCI, CFO, CG, CMO, COPPOCK, CTI, DM, ER, ERI, FISHER, INERTIA, KDJ, KST, LRSI, MACD, MOM, PGO, PO, PPO, PSL, PVO, QQE, ROC, RSI, RSX, RVGI, SLOPE, SMI, SQUEEZE, STC, STOCH, STOCHF, STOCHRSI, TD_SEQ, TRIX, TRIXH, TSI, UO, VFI, VWMACD, WILLR

Volatility (24)

ABERRATION, ACCBANDS, ATR, BBANDS, BollingerBands, DONCHIAN, DonchianChannel, HIGH_LOW_RANGE, HWMA, KC, KeltnerChannel, MASSI, NATR, PDIST, RVI, SQUEEZE_PRO, StochasticOscillator, THERMO, TRANGE, TRUE_RANGE, UI, ULCER, VHF, VOLATILITY

Volume (19)

AD, ADOSC, AOBV, AwesomeOscillator, ChaikinMoneyFlow, CMF, CumulativeReturn, EFI, EOM, FI, KVO, MFI, NVI, OBV, PVI, PVOL, PVR, PVT, VPT

Trend (26)

ABOVE, ADX, ADXR, AMAT, AROON, AROONOSC, BELOW, CHOP, CKS, CKSP, CROSS, DECAY, DPO, ICHIMOKU, IchimokuIndicator, LINREG, MINUS_DI, MINUS_DM, PLUS_DI, PLUS_DM, QStick, SAR, TTM_TREND, VORTEX, VortexIndicator, VTX

Statistics (23)

AV, ENTROPY, GEOMETRIC_MEAN, KURTOSIS, MAD, MAMA, MEDIAN, QUANTILE, ROCP, ROCR, ROCR100, SKEW, SSF, STDDEV, STDEV, TrendMassIndex, UlcerIndex, UltimateOscillator, ULTOSC, VAR, VARIANCE, VPT, ZSCORE

Performance (8)

CAGR, DOWNSIDE_DEVIATION, DRAWDOWN, LOG_RETURN, MAX_DRAWDOWN, PERCENT_RETURN, TREND_RETURN, VP

Cycles / Hilbert (7)

EBSW, HTDCPERIOD, HTDCPHASE, HTPHASOR, HTSINE, HTTRENDLINE, HTTRENDMODE

Price Transform (8)

AVGPRICE, FIBONACCI, HL2, HLC3, HLCC4, OHLC4, TYPPRICE, WCLPRICE

Math Functions (4)

LN, LOG10, SIN, SINH

Regression (5)

LINEARREG, LINEARREGANGLE, LINEARREGINTERCEPT, LINEARREGSLOPE, TSF

Smart Money (SMC) (11)

BOS, CDL_DOJI, CDL_INSIDE, CDL_Z, CHOCH, FVG, LIQUIDITY_VOID, MSB, ORDER_BLOCK, SWING_HIGH, SWING_LOW

Other / Legacy (22)

ADI, AVGDEV, CR, DailyLogReturn, DailyReturn, DECREASING, DLR, DR, DX, HT.DCPERIOD, HT.DCPHASE, HT.PHASOR, HT.SINE, HT.TRENDLINE, HT.TRENDMODE, IMI, INCREASING, LONG_RUN, MI, SHORT_RUN, VolumePriceTrend, VolumeWeightedAveragePrice

Candles / Derived (1)

HA

24.2 TA_CandlePatterns — 61 patterns

Use the pattern name as Expression_*_ElementValue. Names are uppercase canonical.

2CROWS, 3BLACKCROWS, 3INSIDE, 3LINESTRIKE, 3OUTSIDE, 3STARSINSOUTH, 3WHITESOLDIERS, ABANDONEDBABY, ADVANCEBLOCK, BELTHOLD, BREAKAWAY, CLOSINGMARUBOZU, CONCEALBABYSWALL, COUNTERATTACK, DARKCLOUDCOVER, DOJI, DOJISTAR, DRAGONFLYDOJI, ENGULFING, EVENINGDOJISTAR, EVENINGSTAR, GAPSIDESIDEWHITE, GRAVESTONEDOJI, HAMMER, HANGINGMAN, HARAMI, HARAMICROSS, HIGHWAVE, HIKKAKE, HIKKAKEMOD, HOMINGPIGEON, IDENTICAL3CROWS, INNECK, INVERTEDHAMMER, KICKING, KICKINGBYLENGTH, LADDERBOTTOM, LONGLEGGEDDOJI, LONGLINE, MARUBOZU, MATCHINGLOW, MATHOLD, MORNINGDOJISTAR, MORNINGSTAR, ONNECK, PIERCING, RICKSHAWMAN, RISEFALL3METHODS, SEPARATINGLINES, SHOOTINGSTAR, SHORTLINE, SPINNINGTOP, STALLEDPATTERN, STICKSANDWICH, TAKURI, TASUKIGAP, THRUSTING, TRISTAR, UNIQUE3RIVER, UPSIDEGAP2CROWS, XSIDEGAP3METHODS

24.3 PricePattern (PRICE_PATTERN_LIST) — 46 patterns

Use the pattern name (CamelCase) as Expression_*_ElementValue.

AscendingTriangle, BearChannel, BearFlag, BearPennant, BearRectangle, BroadeningBottom, BroadeningTop, BroadeningWedgeBottom, BroadeningWedgeTop, BullChannel, BullFlag, BullPennant, BullRectangle, BumpAndRunBottom, BumpAndRunTop, CupAndHandle, DescendingTriangle, DiamondBottom, DiamondTop, DoubleBottom, DoubleTop, ExhaustionBottom, ExhaustionTop, FailureSwingBottom, FailureSwingTop, FallingWedge, HeadAndShoulders, InverseCupAndHandle, InverseHeadAndShoulders, IslandBottom, IslandTop, MeasuredMoveDown, MeasuredMoveUp, ParabolicBottom, ParabolicTop, PivotReversalBottom, PivotReversalTop, RisingWedge, RoundingBottom, RoundingTop, SpikeBottom, SpikeTop, TripleBottom, TripleTop, VBottom, VTop

24.4 PRICE_PATTERN_FIELDS — what each pattern emits

Use as Expression_*_FieldName when ElementType is PricePattern.

OnFormation, FormationDuration, PatternStrength, StartPrice, EndPrice, PriceRange, CurrentPhase

24.5 Field enums per object type (live)

The following field-enum names are served live by /api/builder/schema.js. Fetch them for current values:

Object typeField enum key in /api/builder/schema.jsSample values
OHLC_BarOHLC_FIELDS (13)CLOSE_PRICE, OPEN_PRICE, MAX_PRICE, MIN_PRICE, VOLUME, TYPICAL_PRICE, ...
HeikinAshiBarHEIKIN_ASHI_FIELDS (9)OPEN_PRICE, HIGH_PRICE, LOW_PRICE, CLOSE_PRICE, ...
RenkoBarRENKO_FIELDS (12)CLOSE_PRICE, OPEN_PRICE, MAX_PRICE, MIN_PRICE, ...
TickRevBarTICKREV_FIELDS (10)TickRevEvent, Direction, Open Price, Max Price, ...
FibonnaciBarFIBO_FIELDS (9)TickRevRatioEvent, Direction, Open Price, Max Price, ...
QuotesQUOTES_FIELDS (7)Bid, Ask, MidPrice, SpreadInTicks, OpenDate, ...
TrendObjectTREND_FIELDS (18)TrendSide, TrendSpeedPerHour, FastPrice, SlowPrice, TrendStartPrice, ...
ChannelObjectCHANNEL_FIELDS (20)UpperChannel, LowerChannel, ChannelLength, CurrentLeg, ...
PivotObjectPIVOT_FIELDS (8)Pivot Point, Support 1, Support 2, Support 3, Resistance 1, Resistance 2, Resistance 3 (note: spaces)
PriceMoveObjectPRICE_MOVE_FIELDS (8)onPriceMove, Direction, getCurrentWidth, getCurrentDuration, ...
ABCPatternABC_FIELDS (8), ABC_WAVES (5)Fields: Distance, Direction, Start Price, End Price. Waves: Current, AB, BC, CD, ...
SymbolSYMBOL_FIELDS (6)TicksInPoint, MarginPerK, BuyInterest, SellInterest, ...
FundamentalFUNDAMENTAL_FIELDS (87)EntityPublicFloat, AccountsPayableCurrent, AccountsReceivableNetCurrent, ...
DateValueDATE_VALUES (4)CurrentSysDateTime, CurrentSysDay, CurrentSysTime, DayOfWeek
HourValueHOUR_VALUES (25)"00:00", "01:00", ..., "24:00"
SideValueSIDE_VALUES (3)BID, ASK, NO SIDE

24.6 TIMEFRAMES (9)

Used in Expression_*_Frame:

1Min, 2Min, 5Min, 15Min, 30Min, 1Hour, 4Hour, Daily, Weekly
Live source of truth: All catalogs above mirror what /api/builder/schema.js serves at any moment. If you suspect drift, an AI with web-fetch should curl that endpoint and use its content directly. The static lists above are for offline/no-fetch readers.
GTS — Global Trading Station • Expression Schema Detailed Reference • Updated 2026-05-22 • Curated from ExpressionObject.py via EXPRESSION_OBJECT_JSON_REFERENCE.md, SaaS-filtered.