Conditions

Price distance to indicator

Fires when price is within N% of an indicator value. Useful for "near the moving average" entries. Internal type - `price_distance`.

1 min readUpdated Jun 19, 2026

price_distance is true when the current close is within a percent threshold of the named indicator. Both directions count - above or below, as long as the absolute distance is small enough.

Shape

{ "type": "price_distance", "from": "ema_fast", "max_pct": 5.0 }

Params

  • from - indicator column to measure distance from.
  • max percent - maximum distance as a percent of the indicator value.

Usage

  • Pullback entries: long after a trend-detection bullish flip, but only if price is still close to the trend EMA (max_pct: 5). Prevents entering on a stretched run-away.
  • Mean-reversion: pair with an oversold condition to filter for setups near a support reference.

Pitfalls

  • % choice is symbol-dependent. 5% from EMA20 on BTC is a normal pullback; 5% on ES is multiple ATRs.
  • Volatility regimes change the right threshold. Consider basing it on ATR via comparison instead for adaptive setups.
Price distance to indicator | Help Center | LucraX · LucraX