STRASMORE/EXPLORE 3,214 QUERIES 22Y EQUITIES · 12Y OPTIONS

3,214 answered market questions

every one with its exact SQL, its result and the date it was computed · free, no signup

How Much Slippage to Assume in a Backtest
Distance from the prevailing mid by trade size, AAPL, one midday hourranking · 2026-10-08 · 5×3Preview: 5 ranked values, smallest first. A five cent concession as a share of premium, near-the-money SPY contracts by expiryranking · 2026-10-08 · 5×3Preview: 5 ranked values, smallest first. Quoted spread and the half spread floor, six household names, one midday hourranking · 2026-10-08 · 6×3Preview: 6 ranked values, largest first. A naive open-to-close yardstick, netted against a ladder of slippage assumptionsranking · 2026-10-08 · 6×4Preview: 6 ranked values, smallest first.
Distance from the prevailing mid by trade size, AAPL, one midday hour

Distance from the prevailing mid by trade size, AAPL, one midday hour

most recentas of ranking 5×3read in context →
Distance from the prevailing mid by trade size, AAPL, one midday hour — 5 rows by 3 columns, computed from US exchange, SIP and OPRA data.
size_bucketavg_distance_bpspct_outside_touch
1 to 99 shares0.55214.31
100 to 4990.40114.21
500 to 9990.6316.91
1,000 to 4,9990.52315.38
5,000 or more4.63836.36
the exact SQL behind every number
WITH
    quotes AS
    (
        SELECT
            ticker,
            sip_timestamp,
            toFloat64(bid_price + ask_price) / 2 AS mid,
            toFloat64(ask_price - bid_price) / 2 AS half_spread
        FROM global_markets.cache_stocks_quotes
        WHERE ticker = 'AAPL'
          AND sip_timestamp >= toDateTime('2026-09-16 14:00:00', 'UTC')
          AND sip_timestamp <  toDateTime('2026-09-16 15:00:00', 'UTC')
          AND bid_price > 0
          AND ask_price > bid_price
    ),
    fills AS
    (
        SELECT
            ticker,
            sip_timestamp,
            toFloat64(price) AS fill_price,
            size
        FROM global_markets.stocks_trades
        WHERE ticker = 'AAPL'
          AND sip_timestamp >= toDateTime('2026-09-16 14:00:00', 'UTC')
          AND sip_timestamp <  toDateTime('2026-09-16 15:00:00', 'UTC')
          AND price > 0
          AND size > 0
    )
SELECT
    multiIf(f.size < 100,  '1 to 99 shares',
            f.size < 500,  '100 to 499',
            f.size < 1000, '500 to 999',
            f.size < 5000, '1,000 to 4,999',
                           '5,000 or more')                                      AS size_bucket,
    round(avg(abs(f.fill_price - q.mid) / q.mid) * 10000, 3)                      AS avg_distance_bps,
    round(100 * countIf(abs(f.fill_price - q.mid) > q.half_spread) / count(), 2)  AS pct_outside_touch
FROM fills AS f
ASOF JOIN quotes AS q ON f.ticker = q.ticker AND f.sip_timestamp >= q.sip_timestamp
GROUP BY size_bucket
ORDER BY min(f.size)
$