Build a strategy, test it, and read the result correctly
Strategy Lab converts explicit rules into a reproducible weekly simulation. This guide explains what each control changes, what every result means, and which limitations must remain visible before you trust a historical result.
Six-step workflow
- 01Choose fixed or custom periodsUse a verified template for fixed, repeatable periods or Custom Strategy to set explicit return, SMA, volatility, and high lookbacks.
- 02Define the investable universeSelect the market universe, minimum price, history requirement, and optional sector filter. These settings decide which stocks can be considered.
- 03Set eligibility and rankingEligibility removes stocks that fail your rules. Ranking orders only the stocks that remain. They perform different jobs.
- 04Set portfolio assumptionsChoose position count, allocation method, concentration limits, rebalance frequency, regime behavior, costs, and test period.
- 05Validate before runningResolve blocking errors and read every data warning. A runnable strategy can still carry material research limitations.
- 06Run, inspect, and compareRead return and risk together, inspect individual rebalances, then compare a small number of sensible variants over the same period.
What each control changes
| Section | Purpose | How to use it |
|---|---|---|
| Universe | Defines the stocks that existed in the test candidate pool. | Begin with Nifty 500 for a diversified, more liquid baseline. Minimum weekly bars must cover the longest indicator warm-up. |
| Eligibility | Applies pass or fail gates before ranking. | Use all rules for strict conjunction and any rules for alternatives. Custom-period factors expose a W field for the completed-week lookback. |
| Ranking | Orders the stocks that passed eligibility. | Weights are relative. Parameter and weight combinations are stored with the run, but testing many combinations after seeing results creates overfitting risk. |
| Portfolio | Converts ranks into positions and weights. | Set position count and stock or sector caps before viewing results. Equal weight is the clearest baseline. |
| Rebalance | Controls how often the portfolio can change. | More frequent rebalancing responds faster but usually increases turnover, costs, and sensitivity to the fill assumption. |
| Regime and exits | Reduces exposure or removes holdings when trend conditions weaken. | The Nifty 500 regime is a market-risk gate. Risk-off exposure controls how much remains invested. A rank buffer reduces unnecessary churn. |
| Simulation | Sets period, capital, costs, and the Sharpe risk-free rate. | Use realistic per-side costs and test complete market cycles. Do not choose the period only because it flatters the strategy. |
How the simulation works
Decision date: rules are evaluated using a completed weekly close and information available to the engine at that decision point.
Modeled fill: portfolio changes use the following completed weekly close as an approximation. It does not claim that a real order could fill at that price or size.
Warm-up: the engine derives the requirement from every fixed and custom lookback. Volatility needs one extra close because N weekly returns require N+1 observations.
Costs: the configured basis-point cost is charged per side. Real brokerage, taxes, spread, slippage, gaps, and market impact can be higher.
Reproducibility: each completed run stores its strategy definition, engine version, run ID, warnings, and data fingerprint.
Read the path, not only the ending value
Strategy and benchmark
Both lines start from the same capital. The gap shows cumulative relative performance over the selected window.
Drawdown panel
This shows the percentage fall from the portfolio's prior peak. Long or deep drawdowns reveal risk hidden by CAGR.
Regime shading
Risk-on and risk-off bands show which market-state rule was active. Confirm that exposure changed as intended.
Rebalance markers
Markers identify portfolio decision cycles. Hover near one to inspect eligible stocks, turnover, additions, and removals.
Range and zoom
Use 1Y, 3Y, 5Y, or All, then zoom with the controls or mouse wheel. Drag horizontally to inspect a specific period.
Crosshair and export
Hover for date-level values. Export PNG for review or CSV for independent calculation and record keeping.
What every result metric means
| Metric | Interpretation |
|---|---|
| CAGR | Annualised compounded growth over the complete test period. It is not the average of yearly returns. |
| Total return | The percentage change from initial capital to final portfolio value across the full simulation. |
| Maximum drawdown | The largest peak-to-trough portfolio decline. Smaller is better when comparing otherwise similar strategies. |
| Sharpe ratio | Return above the selected risk-free rate divided by volatility. Use it only as one risk-adjusted comparison measure. |
| Volatility | Annualised variability of weekly portfolio returns. Higher volatility usually means a less stable path. |
| Final value | The simulated ending value after modeled transaction costs, based on the chosen initial capital. |
| Trades | The number of modeled buy and sell transactions generated by the rebalance process. |
| Costs | Total modeled transaction costs. Taxes, bid-ask spread, market impact, and real slippage may not be fully represented. |
| Average exposure | The average percentage of capital invested. Low exposure can reduce both gains and losses and must be considered when comparing CAGR. |
| Average turnover | The average percentage of the portfolio changed at each rebalance. High turnover makes execution assumptions more important. |
| Rebalances | The number of portfolio decision cycles completed during the test. |
| Weeks invested | The number of weekly periods in which the strategy had market exposure. |
CAGR spread: strategy CAGR minus benchmark CAGR. Positive means historical outperformance over the same test window.
Drawdown difference: strategy maximum drawdown minus benchmark maximum drawdown. A negative number means the strategy had the smaller historical drawdown.
How to interpret one result
Assume a run reports 18% CAGR, 35% maximum drawdown, 0.72 Sharpe, 62% average exposure, and 48% average rebalance turnover, while Nifty 500 reports 14% CAGR and 28% drawdown.
Test alternatives without changing the question
Compare accepts two or three strategies. The first selected strategy supplies the shared period, initial capital, costs, and benchmark; each strategy keeps its own eligibility, ranking, portfolio, regime, and exit rules. Comparison curves are normalised to 100 so their paths are directly comparable.
Runs is the private audit ledger for signed-in users. Use the run ID, engine version, and data fingerprint to distinguish a real rerun from a visually similar strategy definition.
Reliability checklist
- The rules have an economic or behavioral reason, not only a good chart.
- The test covers rising, falling, and sideways markets.
- Costs and rebalance frequency are realistic for the selected universe.
- Performance is not produced by one stock, sector, or short interval.
- CAGR remains acceptable after considering drawdown and exposure.
- Turnover and concentration remain practical for real liquidity.
- Small parameter changes do not collapse the result.
- The final version is frozen before a forward shadow test.
Do not mistake a backtest for a forecast
Current data grade is C. Weekly history is based on currently listed stocks and therefore carries survivorship bias. Delisted or historically ineligible securities may be missing.
Factor coverage is enforced. The live Factor coverage panel is authoritative. Limited or blocked factors, including uncertified point-in-time fundamentals, cannot be used in a runnable public strategy.
Avoid overfitting. Repeatedly changing rules or sweeping many lookbacks after seeing the result turns the backtest into a search for historical luck. Freeze periods first, inspect nearby values for stability, and test the final definition forward.
Execution is approximate. Weekly fills can hide gaps, illiquidity, limit moves, spread, taxes, and market impact, especially outside liquid large-cap stocks.
No metric is a recommendation. Strategy Lab is a self-directed research tool. It does not assess suitability or instruct you to buy, sell, hold, size, or rebalance any security.