Strategy Lab
Write simple trading rules and see how they would have done on past prices — including costs, and compared with just holding the stock.
Start from
Buy when the 50-day average crosses above the 200-day; sell on the reverse cross. How this rule works →
Buy when
all rules true, at the closeSell when
any rule trueRisk and costs
Risk per trade works with a stop-loss: e.g. 1% risk and an 8% stop buys about 12.5% of capital. Cost covers brokerage, STT and charges per side.
Log in to save your strategies.
Pick a stock and run the test
Rules are checked at each day's close and traded at the next day's open — no peeking into the future.
Read before you trust a backtest
- Results are hypothetical, for learning only, and not investment advice or a recommendation to trade.
- Price data ends 30 days before today and isn't adjusted for every corporate action. Real fills, slippage and taxes differ.
- Tweaking rules until the curve looks great (overfitting) usually fails on new data. Test the same rules on several stocks and periods.
- Past performance doesn't guarantee future returns.
New to these indicators? Learn them in Zero to Trader and Risk & Psychology.