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.
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"
}
ExpressionName, Expression_left_ElementType, Expression_left_operation, Expression_right_ElementType. Every other field is optional but most types need at least ElementValue + Frame.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
}
| Operator | JSON value | Used between | Notes |
|---|---|---|---|
| less than | "<" | numeric · numeric | e.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 · boolean | both sides must be boolean (UserExpression refs or pattern fires) |
| logical OR | "OR" | boolean · boolean | |
| cross above | ">" + cross flag | numeric · numeric | NLP shortcut "crosses above" — emit as > with cross direction tracking |
| cross below | "<" + cross flag | numeric · numeric | NLP shortcut "crosses below" |
AND / OR between two UserExpression references to build deeper trees. No depth limit — see §16.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).
Valid Frame values: "1Min", "2Min", "5Min", "10Min", "15Min", "30Min", "1Hour", "2Hours", "4Hour", "12Hours", "Daily", "Weekly", "Monthly" — all thirteen the builder offers.
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:
| Indicator | Size1 | Size2 | Size3 | Double1 | Double2 | Notes |
|---|---|---|---|---|---|---|
RSI | 14 (Period) | — | — | — | — | Common: 14 = period |
SMA | 30 (Size) | — | — | — | — | Common: 20, 50, 100, 200 |
EMA | 30 (Size) | — | — | — | — | |
MACD | 12 (Fast) | 26 (Slow) | 9 (Signal) | — | — | Subfields: Macd / Signal / Hist |
BBANDS | 20 (Period) | — | — | 2 (StdDev) | — | Subfields: Upper Band / Middle Band / Lower Band |
STOCH | 14 | 3 | 3 | — | — | Subfields: SlowK / SlowD |
ATR | 14 | — | — | — | — | |
ADX | 14 | — | — | — | — | |
ALMA | 10 (Length) | — | — | 0.85 (Offset) | 6 (Sigma) | |
KC (Keltner Channel) | 20 | — | — | 2 (Mult) | — | Subfields: Lower / Basis / Upper |
DONCHIAN | 20 | — | — | — | — | Subfields: Lower / Mid / Upper |
ICHIMOKU | 9 | 26 | 52 | — | — | Subfields: Tenkan / Kijun / Senkou A / Senkou B / Chikou |
AROON | 14 | — | — | — | — | Subfields: Aroon Up / Aroon Down |
VWMACD | — | — | — | — | — | Subfields: 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.
{
"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.
{
"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"]
}
TA_CandlePatterns over CandlePatterns when generating new expressions.Bar-data accessors. ElementValue is the field within the bar — e.g. CLOSE_PRICE, HIGH_PRICE, VOLUME.
{
"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"]
}
{
"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.
{
"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"]
}
{
"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"]
}
{
"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"]
}
{
"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.
{
"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.
{
"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"]
}
{
"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"]
}
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.
{
"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"]
}
{
"Expression_left_ElementType": "UserExpression", // rewritten by the serializer
"Expression_left_ElementValue": "DOUBLE_BOTTOM_50ticks_FINAL", // rewritten: <pattern>_<TickRevVal>ticks_FINAL
"Expression_left_TickRevVal": 50
}
{
"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"]
}
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.
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
}
]
| FieldName | Returns |
|---|---|
onPriceMove | Boolean event — 1 when price moved PriceMoveValue ticks in PriceMoveDirection within the window. Test with > against FixedVal 0. |
getCurrentWidth | Move size in ticks (numeric — needs a comparison) |
getCurrentSpeed | Ticks per SECOND |
getCurrentDuration | Seconds since the move began |
Direction | 1 = Up, -1 = Down |
Volume · getBasePrice · getStartTime | Volume 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"]
}
{
"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"]
}
{
"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"]
}
{
"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"]
}
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
}
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.
{
"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
}
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.
{
"Expression_left_UseMA": true,
"Expression_left_numElement": 20 // window size
}
{
"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)
}
{
"Expression_left_UseSD": true, // emit BOTH for standard deviation
"Expression_left_UseStandardDev": true
}
UseSD AND UseStandardDev together.
{
"Expression_left_UseHistoryElem": true,
"Expression_left_historyIndex": 3, // 0 = current, 1 = previous bar, etc.
"Expression_left_collectionSize": 4 // lookback depth
}
{
"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, ...
}
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)
}
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
}
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.
| Key | Value |
|---|---|
Expression_left_ElementType | TicksPerPeriod |
Expression_left_ElementValue | The period string — e.g. 1Min, 2Min, 5Min. This is where the period goes, not in a Frame key. |
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"
}
PricePatterns (plural) is rewritten by the serializer to ElementType="UserExpression" with ElementValue="<pattern>_<TickRevVal>ticks_FINAL". If you mean the standalone form, use PricePattern (singular).PriceMoveObject is never emitted as an ElementType in JSON. The wire format is ElementType="UserExpression" with ElementValue = the name of the saved source getter, plus PriceMoveValue / PriceMoveDirection / TimeLimitSeconds on the same side. priceMoveSourceUserExp is the builder's internal config key and is not a JSON field — do not emit it. See §14.ABCPattern is the only branch that emits NumElements. Don't emit it elsewhere.UseSD and UseStandardDev must both be emitted for standard deviation.UseMA / UseEMA / UseTotalSum / UseStandardDev / UseMeanDev / UseMinSeries takes effect per side.size (lowercase) for Bollinger BandsSize (uppercase) for Keltner ChanneluseOpenBar (lowercase u)frameIn (camelCase) for Renko / Heikintags array has two canonical values: "alert" (deployable, fires notifications) and "helper" (reusable building block, never fires on its own). Mix only when intentional.nlpAppliesSymbolToExpression() returns false, so a Symbols key is not applied here — the strategy binds the instrument at deploy, and one expression covers every symbol you attach. Think of the expression as a class and the strategy as the instance. A Symbols: ["..."] key in an imported object is ignored rather than honoured; samples on this page that show one are legacy. See the class/instance model.UserExpression uses to reference them.EmbeddedCustomCodeOperand, CustomizedUserOperand. Lua and account / position operands are available via JSON import where supported by the runtime. See the type field reference.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.
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.
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
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
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
AD, ADOSC, AOBV, AwesomeOscillator, ChaikinMoneyFlow, CMF, CumulativeReturn, EFI, EOM, FI, KVO, MFI, NVI, OBV, PVI, PVOL, PVR, PVT, VPT
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
AV, ENTROPY, GEOMETRIC_MEAN, KURTOSIS, MAD, MAMA, MEDIAN, QUANTILE, ROCP, ROCR, ROCR100, SKEW, SSF, STDDEV, STDEV, TrendMassIndex, UlcerIndex, UltimateOscillator, ULTOSC, VAR, VARIANCE, VPT, ZSCORE
CAGR, DOWNSIDE_DEVIATION, DRAWDOWN, LOG_RETURN, MAX_DRAWDOWN, PERCENT_RETURN, TREND_RETURN, VP
EBSW, HTDCPERIOD, HTDCPHASE, HTPHASOR, HTSINE, HTTRENDLINE, HTTRENDMODE
AVGPRICE, FIBONACCI, HL2, HLC3, HLCC4, OHLC4, TYPPRICE, WCLPRICE
LN, LOG10, SIN, SINH
LINEARREG, LINEARREGANGLE, LINEARREGINTERCEPT, LINEARREGSLOPE, TSF
BOS, CDL_DOJI, CDL_INSIDE, CDL_Z, CHOCH, FVG, LIQUIDITY_VOID, MSB, ORDER_BLOCK, SWING_HIGH, SWING_LOW
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
HA
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
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
Use as Expression_*_FieldName when ElementType is PricePattern.
OnFormationDone // the only field: true/false when the pattern completes
The following field-enum names are served live by /api/builder/schema.js. Fetch them for current values:
| Object type | Field enum key in /api/builder/schema.js | Sample values |
|---|---|---|
OHLC_Bar | OHLC_FIELDS (13) | CLOSE_PRICE, OPEN_PRICE, MAX_PRICE, MIN_PRICE, VOLUME, TYPICAL_PRICE, ... |
HeikinAshiBar | HEIKIN_ASHI_FIELDS (9) | OPEN_PRICE, HIGH_PRICE, LOW_PRICE, CLOSE_PRICE, ... |
RenkoBar | RENKO_FIELDS (12) | CLOSE_PRICE, OPEN_PRICE, MAX_PRICE, MIN_PRICE, ... |
TickRevBar | TICKREV_FIELDS (10) | TickRevEvent, Direction, Open Price, Max Price, ... |
FibonnaciBar | FIBO_FIELDS (9) | TickRevRatioEvent, Direction, Open Price, Max Price, ... |
Quotes | QUOTES_FIELDS (7) | Bid, Ask, MidPrice, SpreadInTicks, OpenDate, ... |
TrendObject | TREND_FIELDS (18) | TrendSide, TrendSpeedPerHour, FastPrice, SlowPrice, TrendStartPrice, ... |
ChannelObject | CHANNEL_FIELDS (20) | UpperChannel, LowerChannel, ChannelLength, CurrentLeg, ... |
PivotObject | PIVOT_FIELDS (8) | Pivot Point, Support 1, Support 2, Support 3, Resistance 1, Resistance 2, Resistance 3 (note: spaces) |
PriceMoveObject | PRICE_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. |
ABCPattern | ABC_FIELDS (8), ABC_WAVES (5) | Fields: Distance, Direction, Start Price, End Price. Waves: Current, AB, BC, CD, ... |
Symbol | SYMBOL_FIELDS (6) | TicksInPoint, MarginPerK, BuyInterest, SellInterest, ... |
Fundamental | FUNDAMENTAL_FIELDS (87) | EntityPublicFloat, AccountsPayableCurrent, AccountsReceivableNetCurrent, ... |
DateValue | DATE_VALUES (4) | CurrentSysDateTime, CurrentSysDay, CurrentSysTime, DayOfWeek |
HourValue | HOUR_VALUES (25) | "00:00", "01:00", ..., "24:00" |
SideValue | SIDE_VALUES (3) | BID, ASK, NO SIDE |
Used in Expression_*_Frame:
1Min, 2Min, 5Min, 10Min, 15Min, 30Min, 1Hour, 2Hours, 4Hour, 12Hours, Daily, Weekly, Monthly
/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.ExpressionObject.py via EXPRESSION_OBJECT_JSON_REFERENCE.md, SaaS-filtered.