Backtesting Guide
Test strategies on historical data before risking real money
Built-in Risk Management: All strategies include automatic stop losses (2× ATR), take profits (4× ATR), trailing stops, volatility-based position sizing (2% risk per trade), and a 10% drawdown circuit breaker. Learn more →
What is Backtesting?
Backtesting is like a time machine for your trading strategy. It takes your strategy and runs it against historical market data to show you how it would have performed in the past.
Simple Analogy
Why Backtest Before Trading?
Validate Your Ideas
See if your strategy actually makes money before risking capital
Build Confidence
Trade with conviction knowing your strategy has worked historically
Optimize Parameters
Find the best settings for your indicators and rules
Understand Risk
See worst-case scenarios and maximum drawdowns
Types of Backtesting
Standard Backtest
Quick validationRun your strategy across a single time period with fixed parameters. Great for initial testing and understanding how a strategy behaves.
Parameter Optimization
Find best settingsTest multiple combinations of parameters to find the optimal settings. For example, testing SMA periods from 5-50 to find which works best.
Walk-Forward Analysis
Most realisticThe gold standard. Divides data into training and testing windows that "walk forward" through time. Optimizes on past data, tests on unseen future data, then repeats.
Avoid Overfitting
Understanding Backtest Metrics
After running a backtest, you'll see several key metrics. Here's what they mean:
Total Return
+45.2%The total percentage gain or loss from start to finish. Simple but doesn't show the journey - you might have been down 50% at one point.
Win Rate
62%Percentage of trades that were profitable. Higher isn't always better - you can have a 40% win rate and still make money if winners are much larger than losers.
Sharpe Ratio
1.85Risk-adjusted return. Measures return per unit of risk. Above 1.0 is good, above 2.0 is excellent. Tells you if high returns came with reasonable risk.
Max Drawdown
-18.5%The largest peak-to-trough decline. This is the worst loss you'd have experienced. Critical for understanding worst-case scenario. Can you handle an 18.5% drop?
Profit Factor
1.65Gross profits divided by gross losses. Above 1.0 means profitable. A profit factor of 1.65 means you make $1.65 for every $1 you lose.
What to Look For
Reading the Equity Curve
The equity curve shows how your account balance changed over time. It's the most visual way to understand your strategy's performance.
Good Equity Curve
- • Smooth upward slope
- • Small, short drawdowns
- • Quick recovery from losses
- • Consistent growth over time
Warning Signs
- • Steep drops (large drawdowns)
- • Long flat periods
- • Gains concentrated in brief periods
- • Erratic, unpredictable swings
Live Backtest Simulation
Watch an equity curve build in real-time
$10,000
+0.0%
--Infinity%
0%
Recent Trades
No trades yet...
Common Backtesting Mistakes
Look-Ahead Bias
Using information that wouldn't have been available at the time
checkAlways use data that would have existed at that moment
Overfitting
Over-optimizing for historical data that won't repeat
checkUse walk-forward analysis and out-of-sample testing
Ignoring Costs
Not accounting for commissions, slippage, and spreads
checkAdd realistic trading costs to your backtest
Survivorship Bias
Only testing on stocks that exist today, ignoring delisted ones
checkUse historical data that includes delisted stocks
Too Short Time Period
Testing on only 6 months of data
checkUse at least 3-5 years covering different market conditions
Step-by-Step: Your First Backtest
Go to Backtesting
Click "Backtesting" in the sidebar menu
Select a Stock
Search for a stock symbol (e.g., AAPL, MSFT)
Choose a Strategy
Start with SMA Crossover - it's beginner-friendly
Set Parameters
Use defaults first, or adjust (Fast: 10, Slow: 50)
Pick Date Range
Select at least 1 year of data for meaningful results
Run the Backtest
Click "Run Backtest" and wait for results
Analyze Results
Check total return, Sharpe ratio, and max drawdown
View Trades
See each buy and sell signal with prices
bookmarkKey Takeaways
- check_circleAlways backtest before trading with real money
- check_circleUse Walk-Forward Analysis for serious validation
- check_circleFocus on Sharpe Ratio and Max Drawdown, not just returns
- check_circleAvoid overfitting by testing on unseen data
- check_circlePast performance doesn't guarantee future results
Ready to Test Your Strategy?
Put your knowledge into practice and run your first backtest.
play_arrowOpen BacktestingReady to Apply What You've Learned?
Start paper trading with real market data and test your strategies risk-free.