# Supertrend Fusion

Inspired by the SuperTrend Fusion indicator (TradingView: Qe9aWBlF), which fuses
trend, momentum, and a choppiness filter to reduce false Supertrend reversals.

## Versions

| Version | File    | Notes                                                      |
|---------|---------|------------------------------------------------------------|
| v1      | v1.json | SuperTrend + Average Force + ADX — full three-layer filter |

## Logic

**Three-layer filter**:
1. **Trend** — Supertrend(10, 3.0) bullish flip (`close cross_over supertrend line`)
2. **Momentum (Average Force)** — EMA(3) of Stochastic %K(14) on close prices.
   Measures where close sits within its recent 14-bar range, smoothed by EMA(3). > 50 = bullish.
   (An open approximation of the original proprietary Average Force calculation.)
3. **Choppiness filter** — ADX(14) > 20. Confirms trending conditions. The original
   indicator uses Choppiness Index; ADX is the DSL-native equivalent.

**Entry**: all three conditions true simultaneously.
**Exit**: Supertrend flips bearish (close crosses below line).

## Indicators

- `Supertrend(10, 3.0)` — stateful ATR-based trailing line
- `lowest(close, 14)`, `highest(close, 14)` — stochastic range (on close, not high/low)
- `apply_func(ema, period=3)` — smooths raw %K into Average Force
- `ADX(14)` — trend strength

## Data requirements

- 1h candles recommended.
- Minimum warmup: ~30 candles.

## Known limitations

- The Average Force calculation uses close-based stochastic (highest/lowest of close,
  not high/low). This is a faithful approximation of the original but differs slightly.
- ADX > 20 is a softer filter than ADX > 25; raises entry frequency slightly vs a
  stricter threshold.
