Backtest a trading strategy on NSE stocks — free

Pick any NSE stock, choose one of six mechanical strategies, set a date range, and the backtester replays the rules bar by bar over historical daily closes. You get net return after costs, gross return before them, the full trade list with entry and exit prices, win rate, maximum drawdown and an equity curve. Every number is computed from price history in your browser session — nothing is pre-baked, and no signup is required.

The six strategies, and what each one is actually betting on

SMA Crossover (20/50)

Buys when the 20-day simple moving average crosses above the 50-day and exits when it crosses back below. A trend-following rule: it assumes a move that has started tends to continue. It trades rarely, catches large trends well, and gives back a chunk of every trend at the exit because a crossover confirms late by construction.

EMA Trend (9/21)

The same crossover idea on exponential averages, which weight recent prices more heavily. Shorter and faster than the SMA pair, so it enters trends earlier and gets whipsawed more often in sideways markets. Useful for comparing how much the averaging method alone changes a result.

RSI Mean Reversion (14, 30/70)

Buys when the 14-period RSI drops below 30 and sells when it rises above 70. A mean-reversion rule — the opposite bet to the crossovers. It works on range-bound stocks and is punished badly in strong downtrends, where RSI can sit under 30 for weeks while the price keeps falling.

MACD (12/26/9)

Buys when the MACD line crosses above its signal line and exits on the reverse cross. Momentum rather than price level: it responds to the rate of change in two moving averages. Tends to fire more often than an SMA crossover on the same stock.

Bollinger Band Bounce (20, 2σ)

Buys when price closes below the lower band — two standard deviations under the 20-day average — and exits on a return to the middle band. Volatility-relative mean reversion, so its signals adapt as a stock gets calmer or wilder rather than using a fixed percentage.

RSI + MACD confluence

Requires both an RSI level and MACD momentum to agree before entering. Fewer trades than either rule alone. This is the honest test of whether combining indicators helps: usually it raises the win rate while cutting the trade count so far that the total return falls.

Why these returns look worse than other backtesters

Because every round trip is charged. Delivery trades on NSE pay STT at 0.1% of the buy value and 0.1% of the sell value, plus exchange transaction charges, GST on brokerage and charges, SEBI turnover fees and state stamp duty. On top of the statutory bill this tool applies 0.05% per side of slippage — the difference between the price at which your rule triggers and the price you are actually filled at. A backtest run without costs is not a conservative estimate, it is the answer to a different question. That is why the net figure is shown first and the gross figure sits beside it: on a high-frequency rule the gap between the two is often the entire result.

Read the out-of-sample column, not the headline number

The parameter optimiser grid-searches a strategy's settings on the first stretch of price history, then re-runs the best combinations on the later stretch the search never saw. Those two columns are the point of the feature. Any set of parameters can be tuned to look excellent on data it was fitted to; what matters is whether it survives on data it was not. A large gap between in-sample and out-of-sample means the settings memorised past noise, and a combination that reports "no trades" out of sample is telling you the rule was fitted so tightly that it stopped firing at all.

Backtesting FAQs

What is backtesting a trading strategy?

Backtesting replays a mechanical set of entry and exit rules over historical price data to see what the rules would have done. It answers a narrow question — "did this rule make money on this stock over this period" — and nothing more. It cannot tell you whether the rule will work next month, because a backtest only ever sees data the rule was chosen after looking at.

Why are my returns lower here than on other backtesting tools?

Because trading costs are charged on every round trip rather than ignored. Delivery trades on NSE pay STT at 0.1% on the buy value and 0.1% on the sell value, plus exchange transaction charges, GST, SEBI turnover fees and stamp duty. On top of that this tool applies 0.05% per side of slippage — the gap between the price your rule triggers at and the price you actually get filled at. A tool that reports gross returns is not being optimistic, it is answering a question that has no bearing on your account. Both figures are shown, net first, so the drag is visible.

What is the difference between in-sample and out-of-sample results?

The parameter optimiser tunes settings on the first portion of the price history (in-sample), then re-runs the winning settings on the later portion the tuning never saw (out-of-sample). Judge a setting by the out-of-sample column. A strong in-sample number next to a weak out-of-sample number means the parameters memorised past noise instead of finding a repeatable pattern — the single most common way backtests mislead people.

Which strategy is best for intraday trading in India?

None of these, as configured. The strategies here run on daily closing prices and model delivery-segment costs, which makes them swing and positional tools rather than intraday ones. Intraday trading pays a different cost structure (0.025% STT on the sell side only, but far more round trips) and needs intraday bars to be tested honestly. Treating a daily-bar backtest as an intraday result is the fastest way to get a number that cannot be reproduced with real money.

How many trades do I need before a backtest means anything?

As a rough floor, thirty or so closed trades before a win rate carries any information, and more than that before a profit factor does. A strategy showing +180% on four trades is describing four lucky events, not an edge. Widen the date range or loosen the parameters until the trade count is large enough to argue with, and be suspicious of any result built on a handful of trades.

Does a profitable backtest mean the strategy will work?

No. Backtests suffer from survivorship in the stock list, look-ahead in the data, and selection bias in the person running them — you stop testing when you find a good number, which guarantees the good number is partly luck. Use a backtest to reject rules that clearly do not work, which it does reliably, rather than to confirm rules you already like. This is a research tool, not investment advice.

Related tools

Found a rule worth watching? Screen for stocks that match it right now in the NSE stock screens, check how the whole market is positioned on the live market dashboard, or read the indicator guides for how RSI, MACD and Bollinger Bands are calculated.

Backtested results are hypothetical and do not represent actual trading. Past performance does not indicate future results. MarketsEasy is not a SEBI-registered investment adviser and this tool is for research and education only.