Strategy Builder Reference
Every condition, value ref, enum, and spec you can compose into a Quawd strategy. Each object links to its detail page with fields and the exact JSON schema.
Conditions
60
Value refs
27
Enums
51
Specs
2
Conditions
60 conditions
Conditions
Trend
5 conditionsma_crossoverMoving-average crossover entry/gate (fast MA vs slow MA, golden/death cross)
price_vs_maPrice compared to a moving average (entry/gate/exit; level or cross semantics)
regime_filterUptrend/downtrend regime gate (direction:uptrend|downtrend, indicator:ema_cross|price_vs_ma=ema_cross, fast_period:int=20, slow_period:int=50)
trend_adxADX trend strength (period, op, threshold — e.g. ADX(14) >= 25 trending)
trend_ma_relationMA spread (fast vs slow, >0 = uptrend)
Momentum
2 conditionsVolatility
3 conditionsVolume
2 conditionsBands
4 conditionsband_distancePrice distance from band (z-score or band multiple). Example band: {"band":"bollinger","length":20,"mult":2}
band_edgeEDGE event: price touches/crosses a band edge (Bollinger, Keltner, Donchian) — fires on the touch / cross_in / cross_out bar. USE WHEN you want one-shot trigger on the boundary event. DO NOT USE when you want every bar price is outside the band — use 'band_level' for that level/state semantics. Sub-field `band` requires {band:bollinger|keltner|donchian|vwap_band, length:int, mult:float=2.0}. Aliases: period→length, std→mult. Note: std_dev is NOT accepted — use mult. Example band: {"band":"bollinger","length":20,"mult":2}
band_levelLEVEL event: price is currently inside or outside a band — true every bar the condition holds. USE WHEN gating (e.g. 'while price is outside upper Bollinger, suppress new entries'). DO NOT USE for one-shot triggers on band breach — use 'band_edge' for the touch / cross_in / cross_out edges. Level counterpart to 'band_edge'. Example band: {"band":"bollinger","length":20,"mult":2}
band_reentryPrice re-enters band from outside. Example band: {"band":"bollinger","length":20,"mult":2}
Price signals
13 conditionsavwap_reversionAnchored VWAP mean reversion signal
breakoutPrice above N-bar high/low (level/state — true every bar; for edge-based use cross+swing)
breakout_retestBreakout followed by pullback retest
compareLEVEL comparison on continuous values: lhs op rhs, true every bar the relation holds. USE WHEN: gating on a sustained condition (e.g. close > SMA(200), RSI < 30 throughout the consolidation). DO NOT USE for one-shot edge events — use 'cross' to fire once on the crossing bar. DO NOT USE for membership in a discrete set — use 'in_set'. For named zones inspect builder_discover(action='get', ref='workflow:named_anchor_zone'); for anchor fields use value_ref:anchor.
crossEDGE event on continuous values: fires once on the bar where lhs crosses rhs (was below/above, now the other side). USE WHEN: price crosses a moving average, indicator crosses a level (e.g. RSI crosses 30), Stochastic K crosses D. DO NOT USE for discrete/categorical refs like supertrend.direction ({-1,+1}) — use 'transition' instead. DO NOT USE when you want every bar the relation holds — use 'compare' for level/state semantics. For named zones inspect builder_discover(action='get', ref='workflow:named_anchor_zone').
divergencePrice/indicator divergence (RSI, MACD, Stochastic, CCI, OBV)
gapGap from previous close
in_setLEVEL membership on discrete/categorical values: true every bar value ∈ members (or its negation). USE WHEN: gating on SuperTrend direction == +1, regime label in {bull, neutral}. DO NOT USE on continuous values — use 'compare' instead. Cleaner than anyOf(compare(value == m) ...). The discrete-valued counterpart to 'compare'.
intermarketIntermarket relationship signal
spreadSpread between two instruments (ratio, difference, log_ratio, zscore)
trailing_breakoutTrailing breakout pattern. Example band: {"band":"bollinger","length":20,"mult":2}
trailing_entryTrailing band breakout entry (enter on band breach with trailing reference)
transitionEDGE event on discrete/categorical values: fires once on the bar where ref's value differs from the prior bar (optionally constrained to a (from, to) pair). USE WHEN: SuperTrend direction flips (-1 → +1), regime label changes, any small-set categorical ref changes value. DO NOT USE on continuous values like price or RSI — use 'cross' for those. The discrete-valued counterpart to 'cross'.
Price levels
6 conditionsfvgFair Value Gap -- 3-candle imbalance zones
liquidity_sweepSweep below support then reclaim
order_blockOrder Block -- institutional S/R zone
oteOTE -- Fibonacci retracement zone
price_level_crossPrice crosses through a level — level_reference:(session_high|session_low|previous_high|previous_low|recent_support|recent_resistance)
price_level_touchBar touches a price level — level_reference:(session_high|session_low|previous_high|previous_low|recent_support|recent_resistance)
Patterns
3 conditionscandle_patternCandlestick patterns (bullish_engulfing, bearish_engulfing, hammer, doji, morning_star, three_white_soldiers, etc. — see full enum via builder_discover(action='get', ref='condition:candle_pattern'))
flag_patternFlag chart pattern (momentum + consolidation + breakout)
pennant_patternPennant chart pattern
Temporal
2 conditionsTime & events
6 conditionsat_timeExecute at a specific clock time (e.g. 'buy at 10:16'). Time is HH:MM in the exchange session timezone. Fires on the bar starting at that time; a market order fills the next bar, so precision equals the strategy resolution (run 1-minute bars for an exact time). Off-grid times snap to the nearest bar boundary and warn. Needs intraday bars.
calendar_schedulePeriodic schedule (daily, weekly, monthly)
eod_flattenEnd-of-day flatten exit: close open positions N minutes before session close. No-op for crypto (24h sessions); silently inert outside session. NaN trap: NotCondition wrapping evaluates True outside session; prefer AllOf with an in-session gate over Not.
eventReact to external events (FOMC, earnings)
session_filterSession time-window gate (days + intraday window + timezone)
time_filterDay-of-week, time-of-day, month filters. days_of_week takes lowercase strings ['monday','tuesday',...] (NOT 0-6 integers); months_of_year takes ['january',...]. time_window is 'HH:MM-HH:MM' UTC by default.
Risk management
5 conditionsfixed_targetsFixed stop-loss / take-profit / time-stop (supports take_profit_tiers for staged partial exits)
stop_lossSingle stop-loss threshold exit (simpler than fixed_targets when only SL needed)
take_profitSingle take-profit threshold exit (simpler than fixed_targets when only TP needed)
trailing_stateCustom trailing state machine
trailing_stopTrailing stop from the extreme price since entry; trail distance is either an ATR multiple (atr_mult) or a percent (trail_pct)
Cross-sectional
4 conditionscross_sectional_percentileCross-sectional percentile of source in [0.0, 1.0] across portfolio siblings on current bar. Semantic alias for rank with explicit percentile interpretation. Requires universe/portfolio.
cross_sectional_zscoreCross-sectional z-score of source across portfolio siblings on current bar (sample stddev; 0.0 when N<2 or stddev==0). Requires universe/portfolio.
rankCross-sectional rank of source in [0.0, 1.0] across portfolio siblings on current bar (lowest=0, highest=1). Requires universe/portfolio with 2+ symbols.
sibling_compareCompare this sleeve's source to a named sibling sleeve's sibling_source on current bar (pairs trades). Symbol must be a member of the portfolio universe.
Combinators
5 conditionsallOfLogical AND -- all child conditions must be true.
always_trueAlways true -- fires on every bar. Use as a no-op placeholder or unconditional trigger.
anyOfLogical OR -- at least one child condition must be true.
notLogical NOT -- inverts the inner condition.
sequenceOrdered sequence -- steps must fire in order, each optionally within N bars.
Value refs
27 value refs
Value refs
Typed references that resolve to a number at evaluation time.
anchorOHLC field of a captured anchor bar (builder_save_anchor) — anchor_id, anchor_field: open|high|low|close|mid. Requires prior builder_save_anchor call.
binary_exprBinary expression over two SignalRef operands — op: +|-|*|/|max|min. Compiles to a binary IRExpression so you can build composite expressions like (high + low) / 2 or max(rsi, cci).
constantconstant value reference
dist_from_vwap(close - VWAP) / VWAP * 100. No extra fields required.
entry_barOHLC of the signal bar of the currently open position — entry_bar_field: open|high|low|close|range|body_high|body_low. NaN when flat; cleared on position close.
equityRunning equity curve value.
event_fieldEvent payload field — event_type_id, event_field; use list_event_types().
gap_pctGap percentage from the previous bar's close — (open - prev_close) / prev_close * 100. Same formula the top-level gap_pct condition uses; exposed as a value_ref so gap can be combined with other indicators inside compare/cross. No extra fields required.
indicatorIndicator output — RSI, CCI, EMA/SMA, ATR, ADX, ROC (decimal: 0.05=5%), MACD/signal/histogram, stochastic_k/d, Bollinger bands, volume_sma, pivot levels. Use builder_discover(action='get', ref='value_ref:indicator') for the full field list.
live_positionMetric computed from the currently open position (live, not frozen) — field: entry_price | bars_in_position | unrealized_pnl_pct | unrealized_pnl_usd | max_excursion_pct | min_excursion_pct. NaN when flat.
named_zoneBoundary of a saved named zone (builder_save_zone) — zone_id, zone_field: upper|lower|mid. Requires prior builder_save_zone call.
percentileRolling percentile rank of a price field — field, lookback_bars.
prev_barOHLCV field of a prior bar — field, offset (default 1 = previous bar).
pricePrice field — open, high, low, close. Use value_ref:volume for volume (VIB-1317).
rolling_maxRolling max of a price field or arbitrary ValueRef source — set exactly one of `field` (open|high|low|close) or `source` (nested SignalRef, e.g. indicator). Also takes lookback_bars.
rolling_minRolling min of a price field or arbitrary ValueRef source — set exactly one of `field` (open|high|low|close) or `source` (nested SignalRef, e.g. indicator). Also takes lookback_bars.
rolling_statsRolling statistic over a nested SignalRef source — stat: mean|std|zscore|sum|count|rank|percentile. Required fields: source (nested SignalRef), lookback_bars. percentile also requires percentile_level (0-100).
sequence_stepOHLC of the bar that matched a named step inside a named SequenceCondition — sequence_id (id on the sequence), step_id (id on the step), step_field: open|high|low|close|range|body_high|body_low. Captured at step fire, preserved for the lifetime of the open position, cleared on position close. NaN before the step has fired or when flat.
sessionSession value — session_field: high|low|open|close|prior_close|bars_into_session|range|mid|in_session (boolean 1.0/0.0, never NaN; use to gate around TimeRef NaN trap). Optional window_start (HH:MM) + window_duration_minutes for intraday sub-windows (e.g. opening range).
shared_signalPortfolio-level shared signal by name (VIB-2102) — name references a Portfolio.shared_signals entry. Resolves only inside a multi-member portfolio; bound to a member-local metric at compile time. Illegal in a standalone strategy.
swingRecent swing high/low — swing_type: high|low, strength (bars each side), offset (0=latest).
timeCurrent bar's time component — component: hour|minute|day_of_week (0=Mon)|day_of_month|month|minutes_since_midnight|minutes_to_close|minutes_since_open. Session-aware variants return NaN for crypto/outside-session (silent-False); use AllOf with session.in_session==1 to gate around it (avoid Not wrapping).
trade_historyTrade statistics — trade_count, consecutive_wins, consecutive_losses, last_pnl, last_pnl_pct, rolling_win_rate.
triggering_zoneBoundary of the entry ZoneCondition's firing zone — level: upper|lower|mid. Use in standing-exit sl_price_ref. Requires a required ZoneCondition.
unary_exprUnary expression over a SignalRef source — op: abs|neg|log|log10|sqrt|pct_change. Compiles to a unary IRExpression so you can build e.g. abs(close - open) or log(volume).
ValueRefThe union of all value references usable as a signal.
volumeBase-asset trading volume for the current or a prior bar — offset (default 0 = current, 1..500 = prior bars).
Enums
51 enums
Enums
Bounded option sets referenced by condition and value-ref fields.
Anchor3 values: month_start, session_open, week_open
Anchor Field6 values: close, high, low, mid, open, range
Band Edge2 values: lower, upper
Breakout Direction3 values: down, same, up
Calc Type4 values: difference, log_ratio, ratio, zscore
Confirm2 values: close_only, intrabar
Direction3 values: bearish, both, bullish
Direction2 values: downtrend, uptrend
Direction3 values: both, high, low
Direction2 values: long, short
Direction2 values: above, below
Direction3 values: exit, long, short
Divergence Type2 values: bearish, bullish
Edge3 values: lower, mid, upper
Entry Bar Field7 values: body_high, body_low, close, high, low, open, range
enum_april_august_december_february_january_july_june_march_12 values: april, august, december, february, january, july, june, march, may, november, october, september
enum_friday_monday_saturday_sunday_thursday_tuesday_wednesda7 values: friday, monday, saturday, sunday, thursday, tuesday, wednesday
enum_previous_high_previous_low_recent_resistance_recent_sup6 values: previous_high, previous_low, recent_resistance, recent_support, session_high, session_low
Event3 values: cross_in, cross_out, touch
Every5 values: 1d, 1m, 1w, 2w, 3m
Field6 values: bars_in_position, entry_price, max_excursion_pct, min_excursion_pct, unrealized_pnl_pct, unrealized_pnl_usd
Field8 values: day_of_month, day_of_week, hour, minute, minutes_since_midnight, minutes_since_open, minutes_to_close, month
Field8 values: bars_since_last_exit, consecutive_losses, consecutive_wins, last_pnl, last_pnl_pct, rolling_avg_pnl_pct, rolling_win_rate, trade_count
Field3 values: current, drawdown_pct, peak
Field4 values: close, high, low, open
Fill2 values: none, previous
Firing2 values: cross, level
Indicator2 values: ema_cross, price_vs_ma
Indicator Type3 values: BB, DC, KC
Level Direction2 values: down, up
Ma Type2 values: ema, sma
Mode2 values: outside, within
Mode3 values: cross_in, cross_out, level
Mode2 values: band_mult, z
Mode2 values: gap_fade, gap_go
Op4 values: <, <=, >, >=
Op6 values: abs, log, log10, neg, pct_change, sqrt
Op6 values: *, +, -, /, max, min
Op4 values: inside, outside, outside_above, outside_below
Op6 values: !=, <, <=, ==, >, >=
Op7 values: !=, <, <=, ==, >, >=, between
Pattern19 values: bearish_engulfing, bullish_engulfing, dark_cloud_cover, doji, dragonfly_doji, evening_star, gravestone_doji, hammer, harami, harami_cross, inside_bar, inverted_hammer, marubozu, morning_star, piercing_line, shooting_star, spinning_top, three_black_crows, three_white_soldiers
Select4 values: any, most_recent, nearest, oldest
Session3 values: asia, eu, us
Session Field9 values: bars_into_session, close, high, in_session, low, mid, open, prior_close, range
Side2 values: away_lower, away_upper
Stat8 values: count, ema, mean, percentile, rank, std, sum, zscore
Swing Type2 values: high, low
Trigger Op4 values: above, below, crosses_above, crosses_below
Trigger Type3 values: in_window, post_event, pre_event
Update Rule2 values: max, min
Specs
2 specs
Specs
Reusable structured payloads shared across conditions.