Regime strategy

Supertrend Market Regime

An informational RISK_ON / MIXED / RISK_OFF gauge from the weekly Supertrend of SPY and QQQ — a top-level market filter, not a trade signal.

Production
Market Regime
SPY, QQQ
Backtest
Informational

Performance

Real internal-backtest statistics from the registry — Internal backtest · long SPY while weekly SPY+QQQ Supertrend is RISK_ON · 22 trades · 1999–2026 (Yahoo Finance).

59.1%
Win rate
4.86
Profit factor
+5.84%
Avg / trade
8.62%
Max drawdown
CAGR
not published
Exposure
not published
22
Total trades
165d
Avg holding

CAGR and exposure are not published for the library yet — we show “—” rather than invent them. Max drawdown, best year and worst year are undefined for the pooled Momentum universe backtest. Win rate is a share of trades, average return is per trade, and holding period is in trading days.

Historical pattern

No fixed-window historical pattern is published for this strategy — its holding period is variable (or, for a market-wide read, there is no single held window), so a single averaged return path would misrepresent it. Use the backtest for its full trade-by-trade history instead. We never fabricate a curve.

Supertrend Market Regime is informational: it never emits entry/exit signals. It classifies the tape so other strategies can decide whether to run and how aggressively to size:

  • RISK_ON — both SPY and QQQ in weekly Supertrend uptrends.
  • MIXED — only one of the two.
  • RISK_OFF — both in weekly downtrends.

The live API returns the current regime, each index's Bullish/Bearish state and Supertrend value, and when the regime last flipped.

Best for

Cleanly trending markets (up or down), where the weekly trend is unambiguous.

Avoid when

Choppy, range-bound or fast-reversing markets, where any trend measure lags and can whipsaw.

Market behaviour exploited

The primary (weekly) trend of the two indices that lead US equities.

Most trend/momentum setups perform far better when the overall tape is healthy. The weekly Supertrend (ATR 10, multiplier 3) is a robust, objective read of the primary trend; using both SPY and QQQ avoids being fooled by a single index. It is designed as a switch that gates other strategies (e.g., Momentum Breakout only takes entries while RISK_ON).

Live classifier (unchanged, informational)

  • Compute the weekly Supertrend for SPY and QQQ.
  • RISK_ON if both bullish, MIXED if one, RISK_OFF if none.

Backtest methodology ("trade the regime")

Because the live output is a gauge, not a trade, the backtest defines an explicit, standard way to measure the signal:

Go long SPY at the close whenever the regime is RISK_ON; move to cash otherwise.

The regime is computed as-of each session from the last completed week (no intraweek look-ahead) via regimeDailySeries(SPY, QQQ). This does not change the live strategy — the API reading is identical; the backtest simply evaluates how the regime call would have performed as a market timer.

confidenceScore here measures how completely the market matches the risk-on ideal (it is a market-condition measure, not a probability of profit):

ComponentMaxAwarded
spyTrend50SPY in a weekly uptrend
qqqTrend50QQQ in a weekly uptrend

RISK_ON → 100, MIXED → 50, RISK_OFF → 0.

The API returns the passing legs: ["SPY in a weekly uptrend", "QQQ in a weekly uptrend"] (0–2 items).

  • SPY weekly Supertrend bullish?
  • QQQ weekly Supertrend bullish?
  • Use the regime as a filter (which strategies to run, how to size) — it is not itself an entry.
  • Objective, always-on regime read from two leading indices.
  • Strong as a timer — 59% win, PF 4.86, +204% with only 8.6% max drawdown; it sidesteps the deepest bear phases.
  • Composable — designed to gate other strategies (e.g., the Momentum universe backtest uses exactly this regime as its market filter).
  • Whipsaws in choppy markets — a lagging trend measure flips late and can round-trip.
  • Few, long trades — 22 signals over 27 years; the sample is small and outcome-lumpy.
  • QQQ-era only — the regime is undefined before 1999.
  • Not a stock picker — broad-market only; the "trade" is a documented methodology, and the live strategy remains informational.
DimensionIdeal
MarketBroad US equities; any regime — its value is telling you which regime you're in.
TraderAny systematic trader who wants an objective risk-on/off switch before deploying trend/momentum books.
TimeframeWeekly signal; used as a persistent filter, not a fast trigger.
Avoid whenYou need a single-stock signal, or in violently choppy tapes where weekly trend whipsaws.
  • Informational live output. The historical stats come from the trade-the-regime methodology; the live API is still a gauge (no entry/stop/target).
  • Static snapshot. Baked as of 2026; /api/backtest recomputes live.
  • Single-vendor, close-to-close. Yahoo prices; regime defined from 1999 (QQQ inception); no costs modelled.
  • Weekly signal applied next session. The backtest acts on the last completed week to avoid look-ahead.

API examples

Real responses from the live endpoints for this strategy.

Live strategy

GET /api/strategies?id=supertrend_regime
GET /api/strategies?id=supertrend_regime
{
  "strategies": [
    {
      "id": "supertrend_regime",
      "name": "Supertrend Market Regime",
      "category": "Macro",
      "asset": "SPY, QQQ",
      "description": "Market Regime: RISK_ON — Both SPY and QQQ are in weekly uptrends → risk-on environment. …",
      "historical": {
        "yearsTested": 27, "winRate": 0.5909, "averageReturn": 5.84,
        "bestYear": 43.95, "worstYear": -8.62, "maxDrawdown": 8.62,
        "averageHoldingPeriod": 165, "profitFactor": 4.86, "totalTrades": 22,
        "source": "Internal backtest · long SPY while weekly SPY+QQQ Supertrend is RISK_ON · 22 trades · 1999–2026 (Yahoo Finance)"
      },
      "historicalPattern": null,
      "status": "Active",
      "entryDate": "2025-05-16",
      "exitDate": "",
      "daysUntilEntry": 0,
      "entryPrice": null, "stopLoss": null, "firstTarget": null, "riskPercent": null, "rewardRiskRatio": null,
      "confidenceScore": 100,
      "confidenceBreakdown": { "spyTrend": 50, "qqqTrend": 50 },
      "explanation": "The broad US market is RISK_ON — 2/2 of SPY and QQQ are in weekly Supertrend uptrends…",
      "checklist": ["SPY in a weekly uptrend", "QQQ in a weekly uptrend"],
      "score": 100, "recommended": true, "weight": "high"
    }
  ]
}

Scanner

GET /api/scan?strategy=supertrend_regime

This is a market-wide regime read, not a per-symbol screen, so /api/scan?strategy=supertrend_regime returns { "supported": false } with a clear message.

Backtest

GET /api/backtest?strategy=supertrend_regime
GET /api/backtest?strategy=supertrend_regime
{
  "strategy": "supertrend_regime",
  "symbol": "SPY",
  "range": { "requestedFrom": null, "requestedTo": null, "testedFrom": "1999-01-04", "testedTo": "2026-08-04", "barsTested": 6931 },
  "metrics": {
    "totalTrades": 22, "winningTrades": 13, "losingTrades": 9,
    "winRate": 0.5909, "averageReturn": 0.0584, "medianReturn": 0.0055,
    "bestTrade": 0.4395, "worstTrade": -0.0715, "averageHoldingPeriod": 164.91,
    "profitFactor": 4.8571, "totalReturn": 2.0442, "maxDrawdown": 0.0862
  },
  "sampleTrades": [
    { "entryDate": "2025-06-09", "exitDate": "2026-03-30", "entryPrice": 599.68, "exitPrice": 631.97, "return": 0.0538, "holdingDays": 202 }
  ],
  "openTradeEntryDate": "2026-04-20"
}

References

  • Olivier Seban, Supertrend indicator (ATR-based trend following).
  • Backtest data: SPY + QQQ daily OHLCV via Yahoo Finance, 1999–2026 (lib/market-data/prices.ts).

*Past behaviour does not ensure future results. confidenceScore measures market condition / setup quality, not the probability of profit.*