walk_forward
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-09-22, from open-source-tradingview-optimizer.
| in_sample_rank | cell | in_sample_sharpe | out_of_sample_sharpe |
|---|---|---|---|
| 1 | 30 / 50 | 1.05 | 0.27 |
| 2 | 25 / 50 | 1.02 | 0.16 |
| 3 | 5 / 200 | 1.01 | 0.85 |
| 4 | 20 / 50 | 0.98 | 0.25 |
| 5 | 5 / 150 | 0.98 | 0.78 |
| 6 | 10 / 100 | 0.96 | 0.71 |
| 7 | 15 / 50 | 0.9 | 0.34 |
| 8 | 15 / 100 | 0.87 | 0.69 |
| 9 | 10 / 200 | 0.84 | 0.84 |
| 10 | 10 / 150 | 0.81 | 0.67 |
| 11 | 5 / 50 | 0.75 | 0.62 |
| 12 | 15 / 150 | 0.71 | 0.76 |
| 13 | 15 / 200 | 0.69 | 0.97 |
| 14 | 25 / 200 | 0.66 | 0.95 |
| 15 | 5 / 100 | 0.66 | 0.75 |
| 16 | 20 / 100 | 0.65 | 0.61 |
| 17 | 10 / 50 | 0.56 | 0.82 |
| 18 | 30 / 150 | 0.51 | 0.88 |
| 19 | 20 / 150 | 0.48 | 0.88 |
| 20 | 30 / 200 | 0.48 | 1.03 |
| 21 | 25 / 150 | 0.46 | 0.88 |
| 22 | 20 / 200 | 0.44 | 1.15 |
| 23 | 30 / 100 | 0.43 | 0.8 |
| 24 | 25 / 100 | 0.32 | 0.61 |
- Rows × columns
- 24 × 4
- 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 |
|---|---|---|---|
in_sample_rank |
number | 1 to 24 | |
cell |
text | 24 distinct values (10 / 100, 10 / 150, 10 / 200…) | |
in_sample_sharpe |
number | 0.32 to 1.05 | |
out_of_sample_sharpe |
number | 0.16 to 1.15 |
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
series AS
(
SELECT arraySort(r -> r.1, groupArray((date, toFloat64(close)))) AS rows_sorted
FROM global_markets.stocks_daily_aggs
WHERE ticker = 'SPY'
AND date >= '2016-01-04'
AND date <= '2025-06-30'
),
grid AS
(
SELECT
arrayMap(r -> r.2, rows_sorted) AS px,
length(arrayFilter(r -> r.1 < toDate('2021-01-01'), rows_sorted)) AS split_at,
g.1 AS fast,
g.2 AS slow
FROM series
ARRAY JOIN
[
(5, 50), (5, 100), (5, 150), (5, 200),
(10, 50), (10, 100), (10, 150), (10, 200),
(15, 50), (15, 100), (15, 150), (15, 200),
(20, 50), (20, 100), (20, 150), (20, 200),
(25, 50), (25, 100), (25, 150), (25, 200),
(30, 50), (30, 100), (30, 150), (30, 200)
] AS g
),
cells AS
(
SELECT
fast,
slow,
arrayMap(
i -> if(arrayAvg(arraySlice(px, i - fast + 1, fast)) > arrayAvg(arraySlice(px, i - slow + 1, slow)),
px[i + 1] / px[i] - 1,
0.0),
range(200, split_at)
) AS is_rets,
arrayMap(
i -> if(arrayAvg(arraySlice(px, i - fast + 1, fast)) > arrayAvg(arraySlice(px, i - slow + 1, slow)),
px[i + 1] / px[i] - 1,
0.0),
range(split_at, length(px))
) AS oos_rets
FROM grid
),
scored AS
(
SELECT
concat(toString(fast), ' / ', toString(slow)) AS cell,
round(arrayAvg(is_rets)
/ sqrt(arrayAvg(arrayMap(r -> r * r, is_rets)) - pow(arrayAvg(is_rets), 2))
* sqrt(252), 2) AS in_sample_sharpe,
round(arrayAvg(oos_rets)
/ sqrt(arrayAvg(arrayMap(r -> r * r, oos_rets)) - pow(arrayAvg(oos_rets), 2))
* sqrt(252), 2) AS out_of_sample_sharpe
FROM cells
)
SELECT
row_number() OVER (ORDER BY in_sample_sharpe DESC) AS in_sample_rank,
cell,
in_sample_sharpe,
out_of_sample_sharpe
FROM scored
ORDER BY in_sample_rank