NursoftAI
schoolLearning Center
Sign InStart Trading Free

Learn

rocket_launchGetting StartedschoolTrading BasicspsychologyStrategieshistoryBacktestingsmart_toyPaper TradingshieldRisk Managementmenu_bookGlossary
Ready to Trade?

Put your knowledge into practice with $100K virtual capital.

Create Free Account
Learnchevron_rightBacktesting Guide
history

Backtesting Guide

Test strategies on historical data before risking real money

schedule10 min readIntermediate
verified_user

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.

lightbulb

Simple Analogy

Imagine you invented a new football play. Before using it in a real game, you'd watch recordings of past games and see "if we had used this play here, would it have worked?" That's exactly what backtesting does for trading strategies.

Why Backtest Before Trading?

verified

Validate Your Ideas

See if your strategy actually makes money before risking capital

psychology

Build Confidence

Trade with conviction knowing your strategy has worked historically

tune

Optimize Parameters

Find the best settings for your indicators and rules

shield

Understand Risk

See worst-case scenarios and maximum drawdowns

Types of Backtesting

play_arrow

Standard Backtest

Quick validation

Run your strategy across a single time period with fixed parameters. Great for initial testing and understanding how a strategy behaves.

Best for: First-time testing, quick validation, learning
tune

Parameter Optimization

Find best settings

Test multiple combinations of parameters to find the optimal settings. For example, testing SMA periods from 5-50 to find which works best.

Best for: Fine-tuning, comparing parameter sets
directions_walk

Walk-Forward Analysis

Most realistic

The 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.

Best for: Serious strategy validation, avoiding overfitting
warning

Avoid Overfitting

Overfitting is when you optimize so much that your strategy works perfectly on historical data but fails in real trading. Walk-forward analysis helps prevent this by always testing on unseen data.

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.85

Risk-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.65

Gross 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.

tips_and_updates

What to Look For

A good strategy has: Sharpe Ratio above 1.0, Max Drawdown you can stomach (usually under 25%), Profit Factor above 1.3, and consistent performance across different time periods.

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

Balance

$10,000

Return

+0.0%

Max Drawdown

--Infinity%

Win Rate

0%

$NaNk$NaNk$NaNk$NaNk$NaNkStart
Day 1 of 0

Recent Trades

No trades yet...

Common Backtesting Mistakes

error

Look-Ahead Bias

Using information that wouldn't have been available at the time

checkAlways use data that would have existed at that moment

error

Overfitting

Over-optimizing for historical data that won't repeat

checkUse walk-forward analysis and out-of-sample testing

error

Ignoring Costs

Not accounting for commissions, slippage, and spreads

checkAdd realistic trading costs to your backtest

error

Survivorship Bias

Only testing on stocks that exist today, ignoring delisted ones

checkUse historical data that includes delisted stocks

error

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

1

Go to Backtesting

Click "Backtesting" in the sidebar menu

2

Select a Stock

Search for a stock symbol (e.g., AAPL, MSFT)

3

Choose a Strategy

Start with SMA Crossover - it's beginner-friendly

4

Set Parameters

Use defaults first, or adjust (Fast: 10, Slow: 50)

5

Pick Date Range

Select at least 1 year of data for meaningful results

6

Run the Backtest

Click "Run Backtest" and wait for results

7

Analyze Results

Check total return, Sharpe ratio, and max drawdown

8

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 Backtesting
arrow_backTrading StrategiesNext: Paper Tradingarrow_forward

Ready to Apply What You've Learned?

Start paper trading with real market data and test your strategies risk-free.

Get Started FreeExplore Strategies