🔥Black Friday Sale: Get 25% OFF Premium with code BLACKFRIDAY — Sale ends December 1st!🎉
Understanding Backtesting Metrics — Win Rate, Profit Factor, Sharpe Ratio Explained

Understanding Backtesting Metrics — Win Rate, Profit Factor, Sharpe Ratio Explained

By HorizonAI Team

You've backtested your strategy and TradingView shows "Net Profit: $50,000" over 3 years. Should you trade it live?

Not so fast. Net profit alone tells you nothing about:

  • Risk taken to achieve that profit
  • Consistency of returns
  • Drawdowns you'll experience
  • Reliability of the strategy

This guide explains the 7 most important backtesting metrics every trader must understand before risking real money.

Why Metrics Matter More Than Net Profit

Example: Two strategies, same profit, different risk

Strategy A:

  • Net Profit: $50,000
  • Max Drawdown: 5%
  • Win Rate: 75%

Strategy B:

  • Net Profit: $50,000
  • Max Drawdown: 45%
  • Win Rate: 30%

Both made $50K, but Strategy A is far superior. You'd endure a 45% account drop with Strategy B—most traders quit before recovering.

Bottom line: Evaluate strategies holistically using multiple metrics.

The 7 Essential Backtesting Metrics

1. Win Rate (Percentage Profitable)

What it is: Percentage of trades that were profitable.

Formula:

Win Rate = (Winning Trades ÷ Total Trades) × 100

Example:

  • 100 total trades
  • 65 winners, 35 losers
  • Win Rate = (65 ÷ 100) × 100 = 65%

Interpretation:

Win RateMeaning
<40%Low win rate (needs high RR to profit)
40-60%Average (typical for most strategies)
60-75%High (mean reversion, scalping)
>75%Very high (suspicious—check for overfitting)

⚠️ Common mistake: Chasing high win rates.

A 30% win rate can be profitable if winners are 3x bigger than losers. A 70% win rate can lose money if losers are 5x bigger than winners.

Win rate means nothing without profit factor and RR.

2. Profit Factor

What it is: Ratio of gross profit to gross loss.

Formula:

Profit Factor = Gross Profit ÷ Gross Loss

Example:

  • Gross Profit: $150,000 (all winning trades combined)
  • Gross Loss: $100,000 (all losing trades combined)
  • Profit Factor = 150,000 ÷ 100,000 = 1.5

Interpretation:

Profit FactorMeaning
<1.0Losing system (gross losses exceed gross profits)
1.0-1.5Marginal (barely profitable after costs)
1.5-2.0Good (solid strategy)
2.0-3.0Excellent (professional-grade)
>3.0Exceptional (or overfitted—verify on out-of-sample data)

Why it's important: Profit factor > 1.5 is the minimum for a tradable strategy after accounting for slippage and commissions.

Real-world adjustment: If backtest shows 1.8 profit factor, assume live trading will be 1.5-1.6 due to slippage. If backtest is <1.5, don't trade it.

3. Risk-Reward Ratio (Average Win / Average Loss)

What it is: Average size of winning trades vs losing trades.

Formula:

Risk-Reward = Average Win ÷ Average Loss

Example:

  • Average winning trade: $300
  • Average losing trade: $150
  • RR = 300 ÷ 150 = 2:1

Interpretation:

RR RatioWin Rate Needed to Break Even
1:150%
1.5:140%
2:133%
3:125%

Key insight: Higher RR allows lower win rate to still be profitable.

Example math:

  • 100 trades, 40% win rate, 2:1 RR
  • Winners: 40 × $200 = $8,000
  • Losers: 60 × $100 = $6,000
  • Net: +$2,000 profit

Even with 60% losing trades, you profit because winners are 2x bigger.

4. Maximum Drawdown

What it is: Largest peak-to-valley decline in account equity.

Formula:

Max Drawdown = (Peak Equity - Trough Equity) ÷ Peak Equity × 100

Example:

  • Account reaches $120,000 (peak)
  • Drops to $90,000 (trough)
  • Max Drawdown = (120,000 - 90,000) ÷ 120,000 × 100 = 25%

Interpretation:

Max DDRisk Level
<10%Low risk (conservative)
10-20%Moderate risk (acceptable for most)
20-30%High risk (psychologically difficult)
>30%Extreme risk (most traders quit)

⚠️ The psychology factor:

Can you handle a 30% drawdown? Most traders say "yes" in backtest, then panic-close the strategy at -15% in live trading.

Rule of thumb: If max drawdown is 25% in backtest, expect 35-40% in live trading due to slippage and bad timing.

Only trade strategies where you can emotionally handle 1.5× the backtested max drawdown.

5. Sharpe Ratio

What it is: Measures risk-adjusted returns (how much return you get per unit of risk).

Formula:

Sharpe Ratio = (Average Return - Risk-Free Rate) ÷ Standard Deviation of Returns

Simplified (for traders):

Sharpe = Average Monthly Return ÷ Std Dev of Monthly Returns

Example:

  • Average monthly return: 3%
  • Standard deviation: 2%
  • Sharpe = 3 ÷ 2 = 1.5

Interpretation:

Sharpe RatioQuality
<0.5Poor (high risk, low return)
0.5-1.0Decent (acceptable but not great)
1.0-2.0Good (most professional strategies)
2.0-3.0Excellent (rare, verify it's real)
>3.0Suspicious (likely overfitted)

Why it matters: Sharpe ratio tells you if returns are worth the volatility.

Example comparison:

Strategy A: 20% annual return, 15% volatility → Sharpe = 1.33
Strategy B: 15% annual return, 5% volatility → Sharpe = 3.0

Strategy B is better despite lower returns because it achieves them with far less risk.

Note: Sharpe ratio >2 in backtests often drops to 1.0-1.5 in live trading.

6. Expectancy (Average $ Per Trade)

What it is: How much you expect to make (on average) per trade.

Formula:

Expectancy = (Win Rate × Avg Win) - (Loss Rate × Avg Loss)

Example:

  • Win Rate: 60%
  • Avg Win: $400
  • Loss Rate: 40%
  • Avg Loss: $200
Expectancy = (0.60 × 400) - (0.40 × 200)
Expectancy = 240 - 80 = $160 per trade

Interpretation:

ExpectancyQuality
NegativeLosing system (don't trade)
$0-50Marginal (barely profitable after costs)
$50-200Good (worth trading)
$200+Excellent (strong edge)

Why it's useful: Tells you if a strategy is worth the time.

If expectancy is $10/trade and you trade 100 times/year, you make $1,000/year. Is that worth the effort and risk? Maybe not.

If expectancy is $300/trade and you trade 50 times/year, that's $15,000/year—more attractive.

Expectancy must exceed transaction costs by 2-3x minimum.

7. Recovery Factor

What it is: Net profit divided by maximum drawdown.

Formula:

Recovery Factor = Net Profit ÷ Max Drawdown

Example:

  • Net Profit: $25,000
  • Max Drawdown: $5,000
  • Recovery Factor = 25,000 ÷ 5,000 = 5.0

Interpretation:

Recovery FactorQuality
<2Poor (high risk relative to profit)
2-5Good (acceptable risk/reward)
5-10Excellent (low DD for profit achieved)
>10Outstanding (rare but achievable)

Why it matters: Shows how efficiently you profit relative to risk taken.

A strategy with $100K profit and $50K max DD (factor = 2) is worse than $50K profit with $5K DD (factor = 10).

How to Read TradingView Strategy Tester

When you backtest a Pine Script strategy, TradingView shows these key metrics:

Overview Tab

Net Profit: $45,320          (Total profit - start here)
Total Closed Trades: 156     (More trades = more statistical validity)
Percent Profitable: 62%      (Win rate)
Profit Factor: 1.84          (MUST be >1.5 minimum)
Max Drawdown: $7,890 (18%)   (Can you handle this?)
Avg Trade: $290              (Expectancy)

Performance Summary Tab

Sharpe Ratio: 1.42           (Risk-adjusted return)
Sortino Ratio: 2.1           (Like Sharpe, but only penalizes downside volatility)
Calmar Ratio: 1.9            (Annual return ÷ max drawdown)

What to Look For

Green flags:

  • Profit factor > 1.5
  • Max drawdown < 20%
  • Sharpe ratio > 1.0
  • Win rate + RR make mathematical sense
  • Consistent returns across years (not one lucky year)

🚩 Red flags:

  • Profit factor < 1.3
  • Max drawdown > 30%
  • Only profitable in one year (not robust)
  • Win rate >80% with low RR (overfitted)
  • Average trade < 2× commission

Metric Trade-Offs: You Can't Have It All

Most strategies optimize for certain metrics at the expense of others:

Strategy TypeHighLow
Mean ReversionWin rate (70%+), Max DDRR, Profit Factor
Trend FollowingRR (3:1+), Profit FactorWin rate (40%)
ScalpingWin rate, Trade frequencyRR, Individual profits
Swing TradingRR, Sharpe ratioTrade frequency

Key insight: Don't compare strategies across types. A trend-following system with 35% win rate is normal. A mean reversion system with 35% win rate is broken.

Example: Evaluating Two Strategies

Strategy A: "Breakout Master"

Net Profit: $78,000
Win Rate: 42%
Profit Factor: 2.3
Max Drawdown: 28%
Sharpe Ratio: 1.7
Avg Win: $950
Avg Loss: $320
RR: 2.97:1
Total Trades: 143

Analysis:

  • ✅ Excellent profit factor (2.3)
  • ✅ High RR (3:1) compensates for low win rate
  • ✅ Good Sharpe ratio
  • ⚠️ High max DD (28%) - need strong psychology
  • Verdict: Strong trend-following system

Strategy B: "Scalper Pro"

Net Profit: $52,000
Win Rate: 78%
Profit Factor: 1.4
Max Drawdown: 12%
Sharpe Ratio: 1.1
Avg Win: $85
Avg Loss: $240
RR: 0.35:1
Total Trades: 892

Analysis:

  • ✅ High win rate (78%)
  • ✅ Low max DD (12%)
  • ⚠️ Low profit factor (1.4) - barely profitable after costs
  • ⚠️ Poor RR (0.35:1) - big losers wipe out many small winners
  • ❌ With commissions, profit factor drops below 1.2
  • Verdict: Not tradable (commissions will kill it)

Pine Script: Display Custom Metrics

Add this to your strategy to show key metrics on chart:

//@version=5
strategy("My Strategy with Metrics", overlay=true)

// Your strategy logic here...

// Calculate custom metrics
totalTrades = strategy.closedtrades
winningTrades = strategy.wons
losingTrades = strategy.losses

winRate = totalTrades &gt; 0 ? (winningTrades / totalTrades) * 100 : 0
avgWin = strategy.grossprofit / math.max(winningTrades, 1)
avgLoss = strategy.grossloss / math.max(losingTrades, 1)
riskReward = avgLoss != 0 ? avgWin / avgLoss : 0

// Display in table
var table metricsTable = table.new(position.top_right, 2, 6, border_width=1)

if barstate.islastconfirmedhistory
    table.cell(metricsTable, 0, 0, "Metric", bgcolor=color.gray, text_color=color.white)
    table.cell(metricsTable, 1, 0, "Value", bgcolor=color.gray, text_color=color.white)
    
    table.cell(metricsTable, 0, 1, "Win Rate")
    table.cell(metricsTable, 1, 1, str.tostring(winRate, "#.##") + "%")
    
    table.cell(metricsTable, 0, 2, "Profit Factor")
    table.cell(metricsTable, 1, 2, str.tostring(strategy.grossprofit / strategy.grossloss, "#.##"))
    
    table.cell(metricsTable, 0, 3, "RR Ratio")
    table.cell(metricsTable, 1, 3, str.tostring(riskReward, "#.##") + ":1")
    
    table.cell(metricsTable, 0, 4, "Total Trades")
    table.cell(metricsTable, 1, 4, str.tostring(totalTrades))
    
    table.cell(metricsTable, 0, 5, "Max DD")
    table.cell(metricsTable, 1, 5, str.tostring(strategy.max_drawdown, "#.##"))

This displays key metrics directly on your chart for quick reference!

Minimum Standards for Tradable Strategies

Before going live, your strategy should meet these thresholds:

MetricMinimumIdeal
Profit Factor>1.5>2.0
Max Drawdown<25%<15%
Sharpe Ratio>1.0>1.5
Win Rate + RRMath worksMath + buffer
Total Trades>50>100
Expectancy>2× costs>5× costs

If your strategy doesn't meet minimums, don't trade it. Go back and refine.

Generate Optimized Strategies with HorizonAI

Instead of manually tweaking parameters to improve metrics, use HorizonAI to generate strategies with target metrics built-in.

Example prompts:

"Create a Pine Script strategy with minimum 2.0 profit factor, maximum 15% drawdown, and 1.5 Sharpe ratio"

"Build a trading strategy optimized for high risk-reward ratio (3:1) with acceptable win rate around 40%"

"Generate a mean reversion strategy targeting 70% win rate with low drawdown under 12%"

HorizonAI optimizes for:

  • ✅ Target profit factor
  • ✅ Drawdown limits
  • ✅ Risk-reward preferences
  • ✅ Win rate goals
Build optimized strategies →

Final Thoughts

Backtesting metrics tell the whole story—net profit is just one chapter.

Before trading any strategy live:

  1. ✅ Check profit factor (>1.5 minimum)
  2. ✅ Verify max drawdown (<20% ideally)
  3. ✅ Calculate Sharpe ratio (>1.0 minimum)
  4. ✅ Confirm win rate + RR make mathematical sense
  5. ✅ Ensure expectancy >2× transaction costs
  6. ✅ Test on out-of-sample data (last 20% of data untouched during optimization)
  7. ✅ Paper trade for 1-3 months to verify live performance matches backtest

Remember: Metrics in live trading are always worse than backtests. Build in safety margins.

Questions about interpreting your strategy metrics? Join our Discord community to discuss with experienced algo traders!