STRASMORE/EXPLORE 2,170 QUERIES

The same 20/50 rule on five liquid names, 2021 through 2025

Answered against 22 years of US equities and 12 years of US options data and published with the query that produced it. This result is stored as of 2026-08-06, from Reproducible Backtest in Python, No API Key.

as of ranking 5×4read in context →
The same 20/50 rule on five liquid names, 2021 through 2025 — 5 rows by 4 columns, computed from US exchange, SIP and OPRA data.
symbolrule_pcthold_pctdays_long_pct
QQQ40.295.967
AAPL24.610559
SPY21.982.471
MSFT12.5117.560
KO3.827.659
Rows × columns
5 × 4
Computed
Completeness
No missing values
Source
US exchange, SIP and OPRA market data
Licence
Strasmore terms · free, no signup
Formats
JSON · CSV · the SQL below

What each column holds

Column definitions for The same 20/50 rule on five liquid names, 2021 through 2025, derived from the stored result.
ColumnTypeRangeNotes
symbol text 5 distinct values (AAPL, KO, MSFT…)
rule_pct number 3.8 to 40.2 percent
hold_pct number 27.6 to 117.5 percent
days_long_pct number 59 to 71 percent

Computed from Strasmore's warehouse of US exchange, SIP and OPRA market data. Equity prices are delayed; options greeks and implied volatility are end-of-day. This result is stored, not recomputed on load — it is exactly the numbers that were returned on , and the query below is what returned them.

the exact SQL behind every number
WITH daily AS
(
    SELECT
        ticker,
        toDate(toTimeZone(window_start, 'America/New_York')) AS d,
        toFloat64(argMax(close, window_start))               AS px
    FROM global_markets.delayed_stocks_minute_aggs
    WHERE ticker IN ('SPY', 'QQQ', 'AAPL', 'MSFT', 'KO')
      AND window_start >= '2020-07-01 00:00:00'
      AND window_start <  '2026-01-01 05:00:00'
      AND (toHour(toTimeZone(window_start, 'America/New_York')) * 60
           + toMinute(toTimeZone(window_start, 'America/New_York'))) >= 570
      AND (toHour(toTimeZone(window_start, 'America/New_York')) * 60
           + toMinute(toTimeZone(window_start, 'America/New_York'))) < 960
    GROUP BY ticker, d
),
averaged AS
(
    SELECT
        ticker,
        d,
        px,
        avg(px) OVER (PARTITION BY ticker ORDER BY d ROWS BETWEEN 19 PRECEDING AND CURRENT ROW) AS fast_ma,
        avg(px) OVER (PARTITION BY ticker ORDER BY d ROWS BETWEEN 49 PRECEDING AND CURRENT ROW) AS slow_ma,
        row_number() OVER (PARTITION BY ticker ORDER BY d)                                      AS session_no
    FROM daily
),
positioned AS
(
    SELECT
        ticker,
        d,
        px,
        lagInFrame(if(session_no >= 50 AND fast_ma > slow_ma, 1, 0), 1)
            OVER (PARTITION BY ticker ORDER BY d ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS long_prior,
        lagInFrame(px, 1)
            OVER (PARTITION BY ticker ORDER BY d ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS px_prior
    FROM averaged
)
SELECT
    ticker                                                                      AS symbol,
    round((exp(sum(log(if(long_prior = 1, px / px_prior, 1.0)))) - 1) * 100, 1) AS rule_pct,
    round((exp(sum(log(px / px_prior))) - 1) * 100, 1)                          AS hold_pct,
    round(avg(long_prior) * 100, 0)                                             AS days_long_pct
FROM positioned
WHERE px_prior > 0
  AND d >= toDate('2021-01-01')
GROUP BY symbol
ORDER BY rule_pct DESC

Run your own version of this

The same 22 years of US equities and 12 years of options data are queryable in SQL or plain English. A free account runs 100 queries a day and takes no card.

More from this analysisReproducible Backtest in Python, No API Key
A 20/50 moving-average crossover on SPY, year by year, against holding ranking 9×4 Same rule, prior-session signal against same-session signal, SPY by year ranking 9×4 US tickers trading in a June week, and how many still traded in June 2026 ranking 11×4 Symbols that printed a final daily bar, by year ranking 10×3 The January 2019 universe, grouped by what happened to each name ranking 9×4 Maximum drawdown against annualized volatility: eight large caps, five years to July 31, 2026 ranking 8×3 See all 2,170 queries →