Conditions

Trend change

Fires the bar on which the trend-detection block flips. Used in trend-following strategies. Internal type - `trend_change`.

1 min readUpdated Jun 19, 2026

trend_change is true on the single bar where the trend detection block reports a new direction (bull/bear/sideways flipping to a different value). The next bar, it's false.

Shape

{ "type": "trend_change" }

No params.

Usage

The classic trend-following entry:

"entry_rules": {
  "logic": "AND",
  "conditions": [
    { "type": "trend_change" },
    { "type": "price_distance", "from": "ema_fast", "max_pct": 5 }
  ]
}

This means "enter the moment the trend flips, but only if price hasn't already run away from the fast EMA."

Requires trend_detection

This condition reads the engine's internal trend state. Set trend_detection.method to something other than none for it to be meaningful.

Pitfalls

  • Single-bar fire means you get one shot per trend flip. If another filter is false on that exact bar, the entry is lost.
  • Trend flips don't always reverse the market. A sideways ↔ bull flip can happen with very little price movement.
Trend change | Help Center | LucraX · LucraX