Reference

Query syntax

The full grammar of a strategy query.

A query is more expressive than "indicator crosses value". This page is the reference for everything the parser understands: the three ways to build a strategy, the expression form for comparisons the flat syntax can't reach, and the capability modules you can stack in a single sentence.

Build modes#

You can author the same strategy three ways: they all compile to the same backtest, and you can switch between them mid session.

ModeBest for
AI Assistant (natural language)Fast drafts from one sentence
Visual builderPrecise condition trees, no syntax
AI copilotRefining either mode by chat
Interchangeable

Switch modes at any time. The parsed strategy carries over both ways: a query reads back as a visual tree, and a visual tree reads back as text.

Expression form#

For comparisons the flat form can't express, rolling windows, N bars ago, multiples, or any indicator used as an operand, write them inline:

Building blockExample
Rolling windowthe 20-bar highest high, 20-bar mean volume
N bars agoRSI vs its value 5 bars ago
Multiplevolume above 2× its 20-bar average
Aggregationhighest, lowest, mean, sum, std or median over a rolling window
Value whenthe RSI value the last time price crossed the 200 EMA (value-when)
Indicator operandEMA of RSI, MACD histogram vs 0

The operators reference is the canonical list; this table mirrors it.

Capability modules#

Eleven building blocks the parser understands, mixable in a single query.

ModuleExample phrase
Divergencebuy on bullish divergence on RSI, bearish OBV divergence; see the supported series
Performance gatesonly trade if performance is above 0%
Multi timeframewhen the daily RSI is above 50
Stop plansmove stop to break-even after 2% profit
Time filtersonly on Mondays / NY session
Risk guardswait at least 5 bars between trades
Structure memoryafter price breaks and retests the level
Pyramidingadd on each new 10-day high up to 3 times
ATR distancethen price moves 2 ATR away
Cross assetwhen BTC is also above its 200 EMA
Volatility regimewhen ATR is in the bottom 10th percentile

Sessions & filters#

FilterValues
Sessions (UTC)New York, London, Tokyo, Sydney
Calendarweekdays, hour windows, blackout months
Risk guardscooldown bars, max trades/day, consecutive loss circuit break, daily loss stop, drawdown circuit break
Structure refsprevious bar H/L, own previous, broken level, previous step
Stackable

Combine modules freely: a daily trend filter, a divergence entry, a break even stop, and Monday only, all in one sentence.

Parsed attributes#

Before you run, the parser exposes exactly what it extracted. Every field is editable in the UI.

FieldNotes
asset / timeframeSymbol + bar size
directionlong or short
marketspot vs futures
timeConstraintrelative or absolute dates
entryConditionsAND, OR, or sequential (ordered with then)
exitConditionsOR, stops, targets
positionSizingrisk %, units, notional

Next: browse the indicator library or the operators you compare with.