# Stochastic + Keltner Channel

A swing trading strategy combining Keltner Channels for trend direction with
Stochastic %K for entry timing. Enters a position when price is in a bullish
Keltner regime and the stochastic is emerging from oversold territory.

## Versions

| Version | File    | Notes                                                             |
|---------|---------|-------------------------------------------------------------------|
| v2      | v2.json | Manual two-bar crossover simulation (prev < 20 AND curr > 20)    |
| v3      | v3.json | Uses proper `cross_over` — cleaner and more expressive            |

## Logic

**Keltner Channel**: `EMA(20) ± 2 × ATR(10)`
**Stochastic %K**: `(close − lowest(low, 14)) / (highest(high, 14) − lowest(low, 14)) × 100`

**Entry** (v2): close > Keltner upper AND stoch[1] < 20 AND stoch > 20.
**Entry** (v3): close > Keltner upper AND `cross_over(stoch_k, 20)`.
**Exit**: %K > 80 (overbought) OR close < EMA(20).

## Indicators

- `EMA(20)` — Keltner midline
- `ATR(10)` — Keltner band width
- `highest(high, 14)`, `lowest(low, 14)` — stochastic range

## Data requirements

- 4h candles recommended.
- Minimum warmup: ~30 candles for EMA/ATR components.

## Known limitations

- No trend filter; the bullish Keltner condition (close > upper band) is a
  momentum signal, not a trend-direction filter. False entries occur near tops.
- The %K calculation uses raw (unstabilised) stochastic, not %D (3-bar SMA of %K).
  Adding smoothing would reduce whipsaws.
