Noon Barbari
Sign up
Browse docs

Indicators

Every indicator the rule engine knows, with its parameters and output fields.

An indicator is referenced inside a leaf as `{indicator: <kind>, ...params}`. Each kind exposes one or more output fields you can address via `field: <name>` (omit `field` for the default first field). Multi-timeframe is supported via `timeframe: '4h'` on any indicator.

KindParametersOutput fieldsTypical use
emaperiod (>=1)valueTrend filter. `ema20 > ema50` for up-bias.
smaperiod (>=1)valueSame as EMA but no smoothing memory.
rsiperiod (default 14, >=2)value (0–100)Mean reversion. `rsi < 30` long, `rsi > 70` short.
macdfast (12), slow (26), signal (9); fast < slowline, signal, histMomentum. `hist crosses_above 0` for entry.
bollingerperiod (20), std_mult (2.0)mid, upper, lowerVolatility envelope. `close < lower` for bounce entries.
atrperiod (14, >=2)valueStop-distance sizing. `stop = entry - atr14 * 2`.
stochasticperiod (14), smooth_d (3)k, d (both 0–100)Cross 20 / 80 lines for mean reversion.
adxperiod (14)adx, plus_di, minus_di`adx > 25` = trending. Pair with `plus_di > minus_di` for up-bias.
vwapperiod (20, rolling window)valueFair-value reference. `close > vwap` = above-average price.
volume_maperiod (20)valueBreakout confirmation. `volume > volume_ma * 1.5`.
trendperiod (50), slope_lookback (5)value (-1 / 0 / +1)Categorical trend filter. `trend == 1` for uptrend, `== -1` for down.
swinglookback (1)last_high, last_low, prev_high, prev_lowBreakout entries (`close > last_high`) and HH/HL filters.
s_trendlookback (1)value (-1 / 0 / +1)SMC-style BOS/CHoCH trend regime — flips after two same-side swing breakouts.
s_trend_validlookback (1)value (-1 / 0 / +1)Same as s_trend but each breakout must be confirmed by the next bar's close.
blackflag_ftsatr_period (14), atr_factor (1.6), fib_lookback (8)trail, extreme, state, fib1, fib2, fib3SuperTrend variant with Black Flag's modified TR and a 38.2 / 50 / 61.8 Fib pullback ladder.
super_trendatr_period (10), factor (3.0)trail, stateStandard SuperTrend on `hl2`. `state == 1` long regime, `state == -1` short regime.
trend_magiccci_period (20), atr_period (5), atr_mult (1.0)trail, state, cciCCI-gated ATR ratchet. Stop ratchets in trend direction while CCI agrees with regime.
vfilength (130), coef (0.2), v_coef (2.5), signal (5)vfi, signal, histVolume Flow Indicator. Oscillator — `vfi > 0` accumulation, `< 0` distribution, `hist` for cross signals.
market_structureswing_lookback (5)state, bos_signal, choch_signal, pivot_high, pivot_low, last_pivot_high, last_pivot_lowSMC market structure on swing pivots. `state` = current regime, `bos_signal` / `choch_signal` fire one bar.
fair_value_gapmin_gap_pct (0.0), expire_bars (0 = never)bull_top, bull_bottom, bear_top, bear_bottom, bull_signal, bear_signal, bull_filled, bear_filled3-bar imbalance with fill tracking. Use `bull_signal` to enter on FVG formation, `bull_filled` to track mitigation.
order_blockswing_lookback (5), retest_tolerance_pct (0.1)bull_top, bull_bottom, bear_top, bear_bottom, bull_signal, bear_signal, bull_retest, bear_retest, bull_mitigated, bear_mitigatedLast opposite candle before a BOS. `bull_retest` triggers when price returns into the zone.
equal_highs_lowslookback (10), tolerance_pct (0.05)eqh_level, eql_level, eqh_signal, eql_signal, eqh_swept, eql_sweptLiquidity pool detection. `eqh_swept` confirms a stop hunt above equal highs — common reversal trigger.
prior_period_levels(no params — keys off the bar timestamp)pdh, pdl, pdo, pdc, pwh, pwl, pwo, pwc, pmh, pml, pmo, pmcPrior day / week / month H/L/O/C. `close > pdh` for break-of-prior-day-high momentum filters.
premium_discount_zonestrailing_lookback (50)trailing_top, trailing_bottom, premium_top, premium_bottom, equilibrium_top, equilibrium_bottom, discount_top, discount_bottom, current_zoneFib-zone classification of the trailing range. `current_zone == 'discount'` for SMC long bias.

New indicator catalogue

The ten indicators added in the Pine-port and SMC clean-room waves. Each card lists description, parameters with defaults, output fields, and a copy-pasteable YAML snippet.

Black Flag Futures Trading System

blackflag_fts

SuperTrend variant by Black Flag. Uses a modified True Range and adds a three-step Fibonacci pullback ladder (38.2 / 50 / 61.8) for partial-take or scaled re-entries inside an ongoing trend.

Parameters:
atr_period (14), atr_factor (1.6), fib_lookback (8)
Fields:
trail, extreme, state, fib1, fib2, fib3

YAML

leaf:
  lhs: { indicator: blackflag_fts, atr_period: 14, atr_factor: 1.6, field: state }
  op: eq
  rhs: { value: 1 }
  dir: long

SuperTrend

super_trend

The textbook SuperTrend — ATR-banded trailing stop on hl2. `state` flips between +1 and -1 only on a close beyond the opposite band.

Parameters:
atr_period (10), factor (3.0)
Fields:
trail, state

YAML

leaf:
  lhs: { indicator: super_trend, atr_period: 10, factor: 3.0, field: state }
  op: eq
  rhs: { value: 1 }
  dir: long

Trend Magic

trend_magic

ATR-ratchet trailing stop gated by CCI. The trail only ratchets toward price when CCI agrees with the prevailing direction — quieter than SuperTrend in chop.

Parameters:
cci_period (20), atr_period (5), atr_mult (1.0)
Fields:
trail, state, cci

YAML

leaf:
  lhs: { bar: close }
  op: gt
  rhs: { indicator: trend_magic, atr_period: 5, atr_mult: 1.0, field: trail }
  dir: long

Volume Flow Indicator

vfi

Markos Katsanos's Volume Flow Indicator — a smoothed, volume-weighted oscillator that flips signs across the zero line as accumulation turns to distribution. Pair the histogram with a trend filter for confirmation entries.

Parameters:
length (130), coef (0.2), v_coef (2.5), signal (5)
Fields:
vfi, signal, hist

YAML

leaf:
  lhs: { indicator: vfi, length: 130, field: hist }
  op: crosses_above
  rhs: { value: 0 }
  dir: long

Market structure (BOS / CHoCH)

market_structure

Detects pivots and emits a Break of Structure or Change of Character on each pivot break. The `state` field carries the current regime so you can use it as a stateful trend filter.

Parameters:
swing_lookback (5)
Fields:
state, bos_signal, choch_signal, pivot_high, pivot_low, last_pivot_high, last_pivot_low

YAML

leaf:
  lhs: { indicator: market_structure, swing_lookback: 5, field: bos_signal }
  op: eq
  rhs: { value: 1 }
  dir: long

Fair Value Gap (FVG)

fair_value_gap

3-bar imbalance: a gap between bar[n-2]'s wick and bar[n]'s wick. Tracks the zone until price fills it; `bull_signal` fires on formation, `bull_filled` fires when the gap is closed.

Parameters:
min_gap_pct (0.0), expire_bars (0 = never)
Fields:
bull_top, bull_bottom, bear_top, bear_bottom, bull_signal, bear_signal, bull_filled, bear_filled

YAML

leaf:
  lhs: { indicator: fair_value_gap, min_gap_pct: 0.1, field: bull_signal }
  op: eq
  rhs: { value: 1 }
  dir: long

Order block

order_block

Last opposite-coloured candle before a Break of Structure. The block stays armed until price retests it (`bull_retest`) or sweeps through it (`bull_mitigated`).

Parameters:
swing_lookback (5), retest_tolerance_pct (0.1)
Fields:
bull_top, bull_bottom, bear_top, bear_bottom, bull_signal, bear_signal, bull_retest, bear_retest, bull_mitigated, bear_mitigated

YAML

leaf:
  lhs: { indicator: order_block, swing_lookback: 5, field: bull_retest }
  op: eq
  rhs: { value: 1 }
  dir: long

Equal highs / lows

equal_highs_lows

Liquidity-pool detector. Marks a level when consecutive highs (or lows) sit within `tolerance_pct` of each other. `eqh_swept` fires the bar the level is taken out — a common stop-hunt reversal trigger.

Parameters:
lookback (10), tolerance_pct (0.05)
Fields:
eqh_level, eql_level, eqh_signal, eql_signal, eqh_swept, eql_swept

YAML

leaf:
  lhs: { indicator: equal_highs_lows, lookback: 10, field: eqh_swept }
  op: eq
  rhs: { value: 1 }
  dir: short

Prior period levels (PDH / PDL / PWH / PWL …)

prior_period_levels

Prior-day, prior-week, and prior-month open / high / low / close. Computed off the bar timestamp — no parameters. Useful for break-of-prior-period momentum and mean-reversion-to-prior-close trades.

Parameters:
(none)
Fields:
pdh, pdl, pdo, pdc, pwh, pwl, pwo, pwc, pmh, pml, pmo, pmc

YAML

leaf:
  lhs: { bar: close }
  op: gt
  rhs: { indicator: prior_period_levels, field: pdh }
  dir: long

Premium / discount zones

premium_discount_zones

Splits the trailing range into discount (lower third), equilibrium (middle), and premium (upper third) by Fib levels. `current_zone` returns the bar's current zone name — strict SMC longs only fire in discount.

Parameters:
trailing_lookback (50)
Fields:
trailing_top, trailing_bottom, premium_top, premium_bottom, equilibrium_top, equilibrium_bottom, discount_top, discount_bottom, current_zone

YAML

leaf:
  lhs: { indicator: premium_discount_zones, trailing_lookback: 50, field: current_zone }
  op: eq
  rhs: { value: 'discount' }
  dir: long

Multi-timeframe

Add `timeframe: '4h'` to any indicator spec to compute it on a higher timeframe and have the value re-broadcast onto your strategy's base bars. The engine handles the resampling — you keep writing rules against bars on your chosen base interval.

Example

leaf:
  lhs: { indicator: rsi, period: 14, timeframe: '4h' }
  op: lt
  rhs: { value: 35 }
  dir: long

Warmup & NaN handling

Indicators emit NaN until they have enough bars to be honest about their output. A NaN-bearing leaf returns False — it does not error, it just abstains. This means new strategies might sit idle for the first N bars of a backtest; that is correct.