The Strategy Lab runs real backtests in the Data Trade Systems Python analytics service while you watch. Pick a strategy, adjust its parameters and transaction costs, and compare the result with buy-and-hold on the same simulated market. Change the market seed to generate a different price history and see how much the “best” parameters depend on the particular history you test on.
Things to try
- Costs matter. Run the moving-average crossover with fast = 5 and slow = 20 at 0 bp, then at 20 bp. The faster the rule, the more it pays in costs.
- Same rule, different market. Keep the parameters fixed and change only the seed. How stable is the Sharpe ratio? This is a cheap way to see why one backtest proves very little.
- Trend versus reversion. Compare the Donchian breakout and Bollinger reversion on the same seed. In which periods does each one make and lose money?
- The overfitting trap. Tune the RSI thresholds until the result looks great on seed 42, then check the same settings on seeds 7, 123 and 2024.
How the lab works
The form calls the analytics service’s REST API, GET /analytics/api/backtest, which:
- generates a reproducible synthetic market (regime-switching, fat-tailed returns) from the seed;
- computes the strategy’s target position at each close using only past data;
- applies each position from the next bar and charges the cost on every change in position;
- returns performance metrics as JSON and renders the chart with matplotlib.
The same API can be used from your own scripts:
curl "http://localhost:8080/analytics/api/backtest?strategy=sma_crossover&fast=20&slow=50&cost_bps=5&seed=42"
The lab uses simulated prices on purpose: every result is reproducible and free of data-licensing issues, and no result can be mistaken for a recommendation to trade a real security.