# The RSI(2) strategy on QQQ, daily closes (Connors' rules, replicated from SPY) - specification (RIP Backtest protocol v1.0 plus the 8 Oct 2026 rules)

Specification written and **frozen 2026-11-07 (approved by the owner the same day: "Da, îngheață și rulează"; draft 1 unchanged)**, before any RSI(2) value, signal or trade was computed on QQQ. Once frozen, any change of a rule is documented and treated as a separate test; bugs may be fixed.

## Why this test, and what was looked at before
- **Chosen by the owner** on 2026-11-06 ("avem date QQQ? facem si pe el acelasi lucru?"), run on 2026-11-07 after the owner saved the Yahoo QQQ history page.
- **A replication.** The same rules passed every gate on SPY the day before (`rsy_spec.md`, RS2-10 Survivor, RS2-5 buried by its trade count only). They are applied here **unchanged**: same indicators, thresholds, exit, costs, periods' calendar boundaries, gates and control. A rule chosen after a good result elsewhere is a weaker test than a new idea; that is stated.
- **Not independent of SPY.** QQQ (the Nasdaq-100) and SPY (the S&P 500) move together and often have their dips on the same days, so a pass here strengthens the SPY result only somewhat; only new data can confirm it.
- **Why it might not (written before the run):** QQQ fell about 80% from 2000 to 2002 and stayed below its 200-day average for much of 2000-2003, so the first period may have fewer than 50 trades; Nasdaq stocks trend harder than the broad index, which can hurt a buy-the-dip rule.
- **Looked at before (disclosed):** the SPY result (above); NQ futures (the same index) in several intraday tests on 1-minute data from 2020, and the IBS daily reversal on NQ (buried). **No QQQ price has been used on the site before.** The data was checked before this draft (dates, dividends, the March 2000 split, total return against Yahoo's adjusted close: x15.265 both), without computing any indicator or return of the rule.

## Instrument and data
- **QQQ**, daily bars from 1999-03-10 (first day) **to 2026-10-20**, the last day of the SPY test; the 13 later days in the file are not used, so new data stays unseen for both ETFs. Source: the Yahoo Finance history page saved by the owner on 2026-11-07 (`data_qqq/qqq_yahoo.html`, extracted by `qqq_parse.js` into `qqq_daily.csv` and `qqq_dividends.csv`: 6,960 days, 90 dividends from 2003-12-24; closes adjusted for the 2:1 split of 2000-03-20). T-bills: the FRED file of the SPY tests. The price files are not republished.
- **Indicators on the raw daily closes; returns are total returns** with each dividend reinvested at its ex-date close, as on SPY.

## Indicators and rules (identical to rsy_spec.md)
- SMA(200) and SMA(5) of closes; RSI(2), Wilder's (smoothing 1/2, seeded with the plain mean of the first two changes). Signals from the 250th day (March 2000).
- **Entry** at the close when the close is above its SMA(200) and RSI(2) is below the threshold, if no position is open. **Exit** at the close of the first later day whose close is above its SMA(5); the next entry is considered from the next day. No stop, no target, no time limit; a position open at the end closes at the last close.
- **Two variants:** **RQ2-10** (RSI(2) below 10) and **RQ2-5** (below 5). Long only.

## Costs
- **0.04% of the price per round trip**, 0.10% as a scenario. The verdict is that of 0.04%.

## Results, periods, gates, control
- **Unit:** net % per trade.
- **Periods (by entry date), the SPY boundaries:** development 2000 .. 2005; validation 2006 .. 2015; holdout 2016 .. 2026-10-20. The holdout has not been used on QQQ, but **2020 .. 2026 was seen through NQ futures** tests and the SPY result is known; it is reported as **partly used**.
- **Six gates per variant:** validation profit factor >= 1.2; at least 50 trades in each period; development **t >= 2.5**; above the 95th percentile of 500 runs of the matched control; positive without the 10 best trades; holdout net positive. Fewer than 30 trades: Inconclusive.
- **Matched control (as on SPY):** random entries on days with the close above its SMA(200) and below its SMA(5), while flat, with one probability calibrated to the real trade count; same exit, costs and fills; 500 runs, seeds 1000 + run; statistic average net % per trade.

## Also reported (descriptive, after the gates)
As on SPY: win rate with its Wilson interval, holding days, time in the market, the worst open loss, by year and period, without the 10 and 20 best trades, the whole strategy with T-bills against buy-and-hold, the crashes, the 0.10% cost, fills at the next open; and **QQQ next to SPY**, including how many entry days the two share.

## Engine and self-test (before the run)
The SPY engine `rsy_lib.js` unchanged, with a QQQ loader in `rqq_lib.js`; `rqq_selftest.js` must pass before any result is printed: the loader (days, closes, dividends, the cut at 2026-10-20, total return against the adjusted close); the engine equal to the independent re-implementation `rsy_ref.js` trade by trade for both variants on QQQ; the control with the real entries reproducing the real trades; the control's pool and calibration; and the SPY self-test still passing. `rqq_run.js` refuses to run unless the self-test passed on the current code and this file is frozen.

## Before the article
Results go to the owner first (in Romanian), with every gate. One article, only with the owner's agreement; the commercial page that prompted the SPY test is not cited (owner's rule).

## Reading the result
"Buried" or "Inconclusive" mean a statistically convincing edge was not demonstrated; neither is proof that none exists. A "Survivor" here would be a replication on a correlated ETF, not independent proof.

## Log
- 2026-11-07: draft 1 written after the data check. Nothing computed.
- 2026-11-07: frozen (draft 1 unchanged), approved by the owner ("Da, îngheață și rulează"). SHA-256 of the frozen text (before this log grew): 875449529a05d6dd15d2324cf5be957577cda431821103a787701d464ba51aa7.
- 2026-11-07, before any result: rqq_selftest.js passed on the first run (the SPY self-test still passes; loader checks: 6,947 days to 2026-10-20, 90 dividends, total return x16.6968 equal to Yahoo's adjusted close; indicators and trades equal to the independent reference; control checks; a mutation detected). Counts only: RQ2-10 213 trades, RQ2-5 111.
- 2026-11-07, the run (`node rqq_run.js`, once, outputs in `rqq_out/`): **RQ2-10 Buried, 3 of 6** (213 trades, +0.492% a trade net, 69% winners; fails the trade count in 2000-2005 (36, as foreseen), development t 2.32 and the control (93.2th percentile); passes validation PF 1.82, without the 10 best +74%, holdout +45% PF 2.00). **RQ2-5 Buried, 5 of 6** (fails only the trade count: 17 / 46 / 48; +0.675% a trade, control 97.4th percentile). Positive in every period for both. 93 of the 213 RQ2-10 entry days are also SPY RS2-10 entry days. Nothing was rerun or changed.
- 2026-11-07: the owner asked for the article ("Yes, write it"). Published from the outputs of the single run, unchanged.
