How to Backtest a Trading Strategy in Python
Three runs of backtest.py on the illustrative 60-bar fileranking ·
2026-09-16 · 3×4
How Implied Volatility Is Calculated
Where the Newton step misbehaves: AAPL vega by strike zone, June 30, 2026ranking ·
2026-08-25 · 6×3
At the money implied volatility and solver convergence, eight names, June 30, 2026ranking ·
2026-08-25 · 8×4
One solve per contract: AAPL implied volatility by strike zone, June 30, 2026ranking ·
2026-08-25 · 6×3
One AAPL contract, re-solved every session into its July 17, 2026 expiryseries ·
2026-08-25 · 29×3
Three runs of backtest.py on the illustrative 60-bar file
Three runs of backtest.py on the illustrative 60-bar file
| run | total_return_pct | max_drawdown_pct | round_trips |
|---|---|---|---|
| raw tape | -49.84 | -50.01 | 2 |
| split-adjusted | 1.19 | -3.91 | 2 |
| split-adjusted, 0.1% slippage | 0.69 | -3.9 | 2 |
the exact SQL behind every number
SELECT
run,
total_return_pct,
max_drawdown_pct,
round_trips
FROM
(
SELECT 1 AS step, 'raw tape' AS run, -49.84 AS total_return_pct, -50.01 AS max_drawdown_pct, 2 AS round_trips
UNION ALL
SELECT 2, 'split-adjusted', 1.19, -3.91, 2
UNION ALL
SELECT 3, 'split-adjusted, 0.1% slippage', 0.69, -3.90, 2
)
ORDER BY step
Related queries
Median shares per executed print, 2024
ranking 5×2
→
Distance from the signal close to the next session's open, 2024
ranking 5×3
→
How far SPY travels after the minute your signal fired (June 2024)
ranking 5×3
→
One rule, two fill conventions: SPY equity curves through 2024
series 12×4
→
See all 3,256 queries →