# Buy 2 Factors, Reversion Entry

A mean-reversion approach filtered by two confirming factors. Enters on RSI
oversold readings within a macro uptrend, exits when RSI is overbought.

## Versions

| Version | File    | Notes                                                         |
|---------|---------|---------------------------------------------------------------|
| v1      | v1.json | RSI < 30 + close > SMA(200); ADX factor omitted              |
| v2      | v2.json | Adds ADX(14) > 20 as Factor 2 — full 3-factor implementation |

## Logic

**Entry** (v1): RSI(14) < 30 AND close > SMA(200).
**Entry** (v2): RSI(14) < 30 AND close > SMA(200) AND ADX(14) > 20.
**Exit**: RSI(14) > 70.

## Factors

1. **Macro uptrend filter**: close > SMA(200) — only buy dips in bull markets.
2. **Trend strength / non-ranging**: ADX(14) > 20 — confirms the market is
   directional (v2 only; was the missing factor in v1).
3. **Entry signal**: RSI(14) < 30 — price is oversold relative to recent history.

## Indicators

- `RSI(14)` — Relative Strength Index on close
- `SMA(200)` — 200-period simple moving average on close
- `ADX(14)` — Average Directional Index (v2 only)

## Data requirements

- 1h candles recommended.
- Minimum warmup: ~200 candles for SMA(200).

## Known limitations

- MACD histogram (originally proposed as an alternative to ADX) requires DSL
  extensions not yet available.
- Exit is RSI > 70 only; no stop-loss. A sharp downside move during an RSI < 30
  entry that never recovers will hold the position indefinitely.
- Mean-reversion strategies can suffer large drawdowns in prolonged downtrends
  even with the SMA(200) filter.
