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 the type field reference. 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. ExternalIndicators
  19. Indicator-Specific Add-ons (MACD, BBands, Keltner, Oscillator, ParabolicSAR)
  20. Reducers / History / Series
  21. Unary Modifiers (Not / Sqrt / Pow / Abs)
  22. Repeat Conditions / Time Limit
  23. TicksPerPeriod (quote-update count)
  24. Implementation Notes & Gotchas
  25. 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_TimeLimitSeconds": 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

Do not emit TA_Indicators — the validator rejects it. Saving returns "ElementType \"TA_Indicators\" is unsupported legacy input; use GTSIndicators". Use GTSIndicators for every regular indicator (RSI, SMA, EMA, MACD, ATR, BBANDS…). The tile is hidden in the builder for the same reason. This section is retained only so existing saved TA_Indicators expressions still load; the keys below otherwise apply unchanged to GTSIndicators.

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": "GTSIndicators",      // NOT TA_Indicators — the validator rejects that
  "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", "10Min", "15Min", "30Min", "1Hour", "2Hours", "4Hour", "12Hours", "Daily", "Weekly", "Monthly" — all thirteen the builder offers.

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": 10,
  "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": "OnFormationDone",       // PricePattern emits only this true/false flag — 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

First, the getter notion — this is what makes price move make sense. An expression that has no operator returns a value instead of true/false. That is a getter: a named building block that never fires on its own. OHLC close on 1Min, EMA(50) on 1Hour, Heikin Ashi close on 5Min — all getters. A price move measures how far a getter's value has travelled from where it started. So you always need two expressions: the getter first, then the price move that names it.

The source can be ANY expression that returns a value. There is no special "price-move source" type — if it is a getter, it works: an OHLC bar field, a Heikin Ashi field, an indicator like EMA or ATR, or any saved value expression of your own. Create it first, then reference it by name.

The wire format uses ElementType: "UserExpression", not "PriceMoveObject". The source name goes in ElementValue and the price-move parameters sit on the same side. (priceMoveSourceUserExp is the builder's internal config name — it is never a JSON key.)

Complete, working pair — getter first, then the move. This is "price moved 100 ticks up within 2 minutes" off a 1-minute close:

[
  {
    "ExpressionName": "SRC_CLOSE_1Min",            // 1) the getter — no operator, returns a value
    "Expression_left_ElementType": "OHLC_Bar",
    "Expression_left_ElementValue": "CLOSE_PRICE",
    "Expression_left_Frame": "1Min"
  },
  {
    "ExpressionName": "PM_CLOSE_1Min_UP_100t_120s",  // 2) the price move over that getter
    "Expression_left_ElementType": "UserExpression",
    "Expression_left_ElementValue": "SRC_CLOSE_1Min",   // the getter, by name
    "Expression_left_FieldName": "onPriceMove",       // boolean event; numeric fields listed below
    "Expression_left_PriceMoveValue": 100,            // trigger size in TICKS — configures the move
    "Expression_left_PriceMoveDirection": "Up",
    "Expression_left_TimeLimitSeconds": 120           // 0/omitted = distance-only
  }
]
FieldNameReturns
onPriceMoveBoolean event — 1 when price moved PriceMoveValue ticks in PriceMoveDirection within the window. Test with > against FixedVal 0.
getCurrentWidthMove size in ticks (numeric — needs a comparison)
getCurrentSpeedTicks per SECOND
getCurrentDurationSeconds since the move began
Direction1 = Up, -1 = Down
Volume · getBasePrice · getStartTimeVolume during the move, price at move start, when it began
PriceMoveValue configures the trigger — it is not a filter. Do not try to express the threshold as a comparison (width > 100 and duration < 120). The size and the window are parameters of the operand. And ticks are symbol-relative: 100 ticks on EURUSD is not 100 ticks on BTCUSDT — divide by Symbol.TicksInPoint if you need an instrument-independent threshold.

The older single-object sample below is kept for reference; prefer the pair above.

{
  "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": "onPriceMove",           // PRICE_MOVE_FIELDS — "Bid" is a Quotes field, not valid here
  "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

TimeLimitSeconds is used in two unrelated places — same key name, different meaning. In §14 it is the price-move window: how long the move has to cover PriceMoveValue ticks. Here it is a repeat-condition window. They are configured on different operands and never interact; read it in the context of the block it appears in.

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_TimeLimitSeconds": 60                // alternative: time-window in seconds
}

22.5 TicksPerPeriod (quote-update count)

Counts quote updates, not price movement. Use this for "N quote updates arrived in a period" — market activity and liquidity. If you mean price travelled N ticks, that is a price move (see §14), a completely different operand.

KeyValue
Expression_left_ElementTypeTicksPerPeriod
Expression_left_ElementValueThe period string — e.g. 1Min, 2Min, 5Min. This is where the period goes, not in a Frame key.
It takes nothing else. No FieldName, no Frame, no Trend, no params — the C++ parser reads only ElementValue. Symbol is inherited. Adding a FieldName or Frame is wrong.

The operand outputs a numeric count of ticks observed in the last closed bar of that period (an integer ≥ 0), so it always needs a comparison against a FixedVal.

"100 quote updates in 2 minutes" — one expression, no composition:

{
  "ExpressionName": "TICKS_2m_GT100",
  "Expression_left_ElementType": "TicksPerPeriod",
  "Expression_left_ElementValue": "2Min",
  "Expression_left_operation": ">",
  "Expression_right_ElementType": "FixedVal",
  "Expression_right_ElementValue": "100"
}

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 the type field reference.

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 GTSIndicators — 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.

OnFormationDone   // the only field: true/false when the pattern completes

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)All eight: onPriceMove, Direction, getCurrentWidth, getCurrentDuration, getCurrentSpeed, Volume, getBasePrice, getStartTime. The NLP page also lists price_move_up/price_move_down — those are alias shortcuts that preset PriceMoveDirection, not extra fields. getCurrentSpeed IS in the enum and works in JSON.
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 (13)

Used in Expression_*_Frame:

1Min, 2Min, 5Min, 10Min, 15Min, 30Min, 1Hour, 2Hours, 4Hour, 12Hours, Daily, Weekly, Monthly
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.