Every trader has ideas: "buy when RSI crosses 30", "buy the breakout of the 20-day high", "buy when the 9 EMA crosses the 21". The question is not whether an idea sounds good. The question is: how did it actually behave over hundreds of trades?
That is what backtesting answers. This guide shows how to backtest a trading strategy properly — and how to do it free, without writing code, using our strategy builder.
What backtesting is (and is not)
Backtesting means applying fixed rules to historical price data and recording every trade those rules would have taken. You then measure results: profit, win rate, drawdowns, number of trades.
It is not a guarantee of future profits. It is a filter: ideas that fail in the past rarely work in the future, while ideas that pass deserve further testing.
Step 1: Write rules a computer could follow
Vague: "buy when the trend looks strong."
Testable: "buy when the close is above the 200 EMA and RSI(14) crosses above 40; exit when RSI crosses above 70 or the close falls below the 200 EMA; stop-loss 5%."
Every part — entry, exit, stop, position size — must be specific.
Step 2: Choose the market and timeframe
- Pick the market you actually trade — Nifty, a stock, Bitcoin, gold.
- Pick the timeframe you will trade — daily, 4-hour or hourly.
- Use enough history to include different market conditions: uptrends, downtrends, ranges and crashes.
Step 3: Include realistic costs
Fees, brokerage, taxes and slippage turn many "profitable" strategies into losing ones, especially on lower timeframes. Always add a fee per trade. In India, use the brokerage calculator to understand your real round-trip costs.
Step 4: Run the backtest
In our no-code strategy builder:
- Choose a symbol and timeframe.
- Add entry rules (e.g. EMA 9 crosses above EMA 21).
- Add exit rules and optional stop-loss/take-profit.
- Set fees, starting capital and position size.
- Click Run backtest.
You will see net profit, buy-and-hold comparison, number of trades, win rate, profit factor, maximum drawdown, time in market, an equity curve and every trade.
Step 5: Read the results like a professional
| Metric | What it tells you | Rough guide |
|---|---|---|
| Net profit vs buy & hold | Did the rules beat simply holding? | Many strategies do not |
| Number of trades | Is the sample meaningful? | 30+ minimum, 100+ better |
| Win rate | How often trades win | Meaningless alone |
| Profit factor | Gross profit ÷ gross loss | Above 1.3–1.5 is interesting |
| Max drawdown | Worst peak-to-trough fall | Could you survive it emotionally? |
| Average trade | Edge per trade after costs | Must clearly exceed costs |
Step 6: Stress-test the result
- Different markets: does it work on several stocks or coins, or just one?
- Different periods: does it hold in both bull and bear years?
- Small parameter changes: if RSI 14 works but RSI 13 and 15 fail, the result is probably luck.
- Losing streaks: use the Monte Carlo simulator with your win rate and average win/loss to see realistic drawdowns.
The biggest backtesting traps
- Overfitting (curve fitting): tweaking rules until the past looks perfect. The more rules and parameters, the higher the risk.
- Look-ahead bias: using information that was not available at the time.
- Ignoring costs: especially fatal for intraday strategies.
- Tiny samples: ten trades prove nothing.
- Survivorship bias: testing only on stocks that still exist today.
From backtest to live trading
- Forward test with paper trades or tiny size for at least 30 trades.
- Record each trade in a trading journal.
- Compare live results with the backtest. Big differences mean something is wrong — execution, costs or the idea itself.
- Increase size slowly.
Test on any market with Pine Script
Our builder uses crypto data from Binance in the browser. To test the same rules on Nifty, Bank Nifty or individual stocks, export the strategy as TradingView Pine Script (available with BullishBrush Pro) and run it in TradingView's Strategy Tester. Read what is Pine Script.
Ready-made strategies to start with
- Golden cross (50/200 SMA)
- EMA 9/21 crossover
- RSI oversold bounce
- MACD with trend filter
- Donchian breakout (Turtle)
Key takeaways
- Backtesting turns ideas into evidence before you risk money.
- Write precise rules, include costs and use enough history.
- Judge by profit factor, drawdown and sample size — not win rate alone.
- Avoid overfitting, then forward test before going live.
Frequently asked questions
Can I backtest without coding?
Yes. Our free strategy builder lets you combine indicators into rules and backtest instantly in your browser.
How many trades do I need for a reliable backtest?
At least 30, and preferably 100 or more across different market conditions.
Why do backtests look better than live results?
Costs, slippage, emotions and overfitting. Forward testing with small size reveals the real performance.
Is a profitable backtest enough to start trading?
No. It is a first filter. Forward test, journal and start small.
BullishBrush केवल शेयर बाज़ार की शिक्षा देता है। हम SEBI-रजिस्टर्ड निवेश सलाहकार या रिसर्च एनालिस्ट नहीं हैं और कोई खरीद-बिक्री की सलाह या टिप्स नहीं देते। शेयर बाज़ार में निवेश बाज़ार जोखिमों के अधीन है; निवेश से पहले सभी दस्तावेज़ ध्यान से पढ़ें। पिछला प्रदर्शन भविष्य की गारंटी नहीं है।