Appearance

Personalize your experience

Mode
Accent Color
Direction
Condition Recipes

Condition Recipes

Coding

Patterns worth knowing by heart: regime detection, confirmation, divergence, volatility gating, session control, and the idioms that express each one cleanly.

How to use these

Each recipe is a , not a . Take the shape, substitute the indicators you actually have a reason to use, and validate it. Copying a recipe verbatim and deploying it skips the only step that matters.

Regime detection

Almost every works in one market and fails in another. A regime is what stops a trend-follower from trading a range, and it is usually the - condition you can add.

trending or ranging
# trending — the standard filter, and the most under-used
ADX(14)  >  25

# trending, with direction
ADX(14)  >  25   AND   DI_Plus(14)  >  DI_Minus(14)

# ranging — the inverse, for mean-reversion strategies
ADX(14)  <  20

# volatility squeeze — a range that is about to stop being one
BB_Width(20,2)  <  Percentile(BB_Width(20,2), 100, 20)

# clean trend versus noisy drift, using path efficiency
Abs(Close - Close[20]) / Sum(Abs(Close - Close[1]), 20)  >  0.3
★
Pro tip:Adding ADX(14) > 20 to a moving-average typically removes a share of the losing , because it removes the sideways periods where a crossover carries no information. If you add one condition to a trend , add this one.

Trigger plus confirmation

The canonical entry : one to fire, one or two conditions to establish that the environment is acceptable. that each condition below measures something different — trend, timing, — rather than the same thing three ways.

one trigger, three filters
AND {
  EMA(21)  >  EMA(55)                     # filter: regime is an uptrend
  Close  crossesAbove  EMA(21)            # TRIGGER: pullback recovered
  RSI(14)  >  40                          # filter: momentum not broken
  Volume  >  Mean(Volume, 20)             # filter: someone is participating
}
RoleTypeDescription
Regime filtervalueEstablishes the market type the is designed for. Usually a moving-average relationship or ADX.
TriggertransitionThe single that fires the entry. Exactly one per signal.
Momentum filtervalueRejects entries where the move has already exhausted itself.
Participation filtervalueVolume confirmation. a price event into a confirmed price event.

Divergence

Price making a new extreme while momentum does not is a exhaustion signal. It is expressible without a custom indicator, using bar indexing on both series.

bearish momentum divergence
AND {
  # price made a new 20-bar high
  Max(High, 20)  ==  High

  # but RSI is lower than it was at the previous high
  RSI(14)  <  Max(RSI(14), 20)[1]

  # and momentum is actually turning, not merely lagging
  RSI(14)  <  RSI(14)[1]
}
!
Caution:Divergence is a , not a timing signal. It can persist for many bars while price continues in the original direction, so use it to out long entries rather than to short ones — and if you do trade it directly, expect a low and size accordingly.

Volatility gating

Two opposite uses. Requiring volatility keeps a breakout out of dead markets; capping it keeps a mean-reversion strategy out of a crisis.

floor and ceiling
# breakout: require enough volatility to travel to the target
ATR(14) / Close * 100  >  1.5

# mean reversion: refuse to fade a market in genuine distress
ATR(14) / Close * 100  <  4.0

# expansion: volatility rising off a low base
AND {
  ATR(14)  >  ATR(14)[10] * 1.3
  BB_Width(20,2)[10]  <  Percentile(BB_Width(20,2), 100, 20)
}

# both bounds — the band a strategy was actually validated in
AND {
  ATR(14) / Close * 100  >  1.0
  ATR(14) / Close * 100  <  5.0
}
★
Pro tip: that every threshold here is normalised — as a of price rather than in price units. That is what lets the same condition work on a ₹50 stock and a ₹5,000 one instead of silently meaning something different on each.

Session control

time gating
# skip the open and the close — the two least representative windows
AND {
  HourOfDay  >=  10
  HourOfDay  <   15
}

# skip only the first thirty minutes, more precisely
SessionMinutes  >  30

# weekdays only, for instruments that trade at weekends
DayOfWeek  <=  5

# force a flat book before the close, independent of session mode
MarketClose  ==  1
!
Caution:Time resolve in the exchange's — IST for NSE, UTC for . The same >= 10 means two completely different windows on those two instruments, and nothing in the builder warns you. Check the exchange before writing a time , and again before reusing one on a different .

Multi-timeframe alignment

Trading a fast timeframe while respecting a slow one, without needing genuine multi-timeframe : approximate the higher timeframe with a proportionally longer on the current one.

approximating a higher timeframe
# on 15m bars, EMA(80) ≈ EMA(20) on 1h bars (4 × 15m = 1h)
AND {
  EMA(80)  >  EMA(200)                    # slow-timeframe trend
  Close  crossesAbove  EMA(21)            # fast-timeframe trigger
}
ℹ
Note:This is an approximation, not an equivalence. A 4× longer on a faster series is smoother than the true higher-timeframe indicator, because it is computed from more, smaller observations. It is close enough to act as a regime and not close enough to act as a trigger.

Composite patterns

See also

Related articles

  • Baseline

    Charts / Chart Types / Area Charts

    A variant of the area chart that uses dual-colored fills — green above the baseline, red below — providing an immediate visual assessment of relative…

  • Cumulative Delta (CVD)

    Charts / Chart Types / Volume Charts

    Candles of the running total of buy volume minus sell volume, with divergence detection against price.

  • Ghost Feed

    Charts / Drawing Tools / Forecasting

    An overlay of another symbol's price data on the current chart. Ghost feeds compare correlated instruments, analyze relative strength, and identify…

  • Order-Book Imbalance Candles

    Charts / Chart Types / Volume Charts

    Candles of how one-sided the resting book was, with what aggressive traders actually did on the same scale.

  • Trade Without Confirmation

    Trading / Quick Trade / Execution

    Skip the review modal and place orders instantly when using Quick Trade.

  • Building Custom Indicators

    Coding / Custom Indicators

    Composing new indicators from existing ones, the recursive shapes that need care, warm-up handling, and how to check a custom indicator is actually correct.

  • Built-in Indicators & Overlays

    Coding / IDE / Reference

    Quatick ships with a full library of pre-built indicators and overlays. You can use these out of the box, or study their implementations as reference for…

  • Coding for Trading — Fundamentals

    Coding / Fundamentals

    The concepts every strategy rests on, whether you write it in the condition builder or in code: series, bar indexing, the difference between a value and a…

  • Debugging Strategies

    Coding / Debugging

    A method for diagnosing strategies that do nothing, do too much, or do the wrong thing — plus the specific symptoms that have specific causes.

Browse all knowledge base articles →