param_sweep
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-10-01, from backtest-vs-forward-test.
| label | cagr_in_sample_pct | cagr_forward_pct |
|---|---|---|
| MA 200 | 8.39 | 7.87 |
| MA 50 | 7.37 | 6.23 |
| MA 150 | 7.29 | 6.37 |
| MA 100 | 6.24 | 4.44 |
| MA 20 | 5.86 | 4.24 |
- Rows × columns
- 5 × 3
- Computed
- Completeness
- No missing values
- Source
- US exchange, SIP and OPRA market data
- Licence
- Strasmore terms · free, no signup
What each column holds
| Column | Type | Range | Notes |
|---|---|---|---|
label |
text | 5 distinct values (MA 100, MA 150, MA 20…) | |
cagr_in_sample_pct |
number | 5.86 to 8.39 | percent |
cagr_forward_pct |
number | 4.24 to 7.87 | 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.
Run it yourself
This is the exact query behind the result above. Change a ticker, a date or a column and run it against the warehouse — no account, no key. The no-signup tier is smaller than the one this page was computed on; a query that reaches past it comes back saying which plan runs it.
WITH px AS (
SELECT
ticker,
date,
toFloat64(close) AS c
FROM global_markets.stocks_daily_aggs
WHERE ticker IN ('SPY', 'MSFT', 'JPM', 'HD', 'PEP')
AND date >= '2008-12-01'
AND date < '2026-10-01'
),
ma AS (
SELECT
ticker,
date,
c,
avg(c) OVER (PARTITION BY ticker ORDER BY date ROWS BETWEEN 19 PRECEDING AND CURRENT ROW) AS ma_20,
avg(c) OVER (PARTITION BY ticker ORDER BY date ROWS BETWEEN 49 PRECEDING AND CURRENT ROW) AS ma_50,
avg(c) OVER (PARTITION BY ticker ORDER BY date ROWS BETWEEN 99 PRECEDING AND CURRENT ROW) AS ma_100,
avg(c) OVER (PARTITION BY ticker ORDER BY date ROWS BETWEEN 149 PRECEDING AND CURRENT ROW) AS ma_150,
avg(c) OVER (PARTITION BY ticker ORDER BY date ROWS BETWEEN 199 PRECEDING AND CURRENT ROW) AS ma_200
FROM px
),
grid AS (
SELECT
ticker,
date,
c,
g.1 AS label,
g.2 AS ma_value
FROM ma
ARRAY JOIN [('MA 20', ma_20), ('MA 50', ma_50), ('MA 100', ma_100), ('MA 150', ma_150), ('MA 200', ma_200)] AS g
),
sig AS (
SELECT
label,
ticker,
date,
c,
any(c) OVER (PARTITION BY label, ticker ORDER BY date ROWS BETWEEN 1 PRECEDING AND 1 PRECEDING) AS prev_c,
any(if(c > ma_value, 1, 0)) OVER (PARTITION BY label, ticker ORDER BY date ROWS BETWEEN 1 PRECEDING AND 1 PRECEDING) AS held
FROM grid
),
port AS (
SELECT
label,
if(date < '2020-01-01', 'in_sample', 'forward') AS window_name,
date,
avg(held * (c / prev_c - 1)) AS r
FROM sig
WHERE prev_c > 0
AND ((date >= '2010-01-01' AND date < '2020-01-01')
OR (date >= '2020-09-01' AND date < '2026-10-01'))
GROUP BY label, window_name, date
),
curve AS (
SELECT
label,
window_name,
date,
exp(sum(log(1 + r)) OVER (PARTITION BY label, window_name ORDER BY date ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)) AS equity
FROM port
),
metrics AS (
SELECT
label,
window_name,
round((pow(argMax(equity, date), 252.0 / count()) - 1) * 100, 2) AS cagr_pct
FROM curve
GROUP BY label, window_name
)
SELECT
label,
anyIf(cagr_pct, window_name = 'in_sample') AS cagr_in_sample_pct,
anyIf(cagr_pct, window_name = 'forward') AS cagr_forward_pct
FROM metrics
GROUP BY label
HAVING countIf(window_name = 'in_sample') > 0
AND countIf(window_name = 'forward') > 0
ORDER BY cagr_in_sample_pct DESC
ใช้ข้อมูลนี้ในผู้ช่วย AI ของคุณ
เปิดพร้อมคิวรีได้ทันที พร้อมข้อมูลของหน้านี้ ฟรี ไม่ต้องมีบัญชี