Skip to main content
Skip to main content
Version: 1.0 (Current)

Performance Metrics Reference

Overview

Performance metrics help you evaluate the effectiveness of your trading algorithms. x3Algo tracks 11 key metrics that provide comprehensive insights into strategy performance, risk, and consistency.

Core Metrics

Total Trades

Description: The total number of completed trades (both winning and losing).

Formula:

Total Trades = Winning Trades + Losing Trades

Interpretation:

  • < 30 trades: Insufficient data for statistical significance
  • 30-100 trades: Minimum acceptable sample size
  • 100-300 trades: Good sample size
  • > 300 trades: Excellent statistical significance

Example:

Winning Trades: 45
Losing Trades: 35
Total Trades = 45 + 35 = 80 trades

Use Cases:

  • Validate strategy robustness
  • Ensure statistical significance
  • Compare strategies fairly

Winning Trades

Description: The number of trades that resulted in profit.

Formula:

Winning Trades = Count of trades where Profit > 0

Interpretation:

  • Used to calculate win rate
  • Higher is better, but not the only factor
  • Must be balanced with average win size

Example:

Total Trades: 100
Winning Trades: 55
Losing Trades: 45

Losing Trades

Description: The number of trades that resulted in loss.

Formula:

Losing Trades = Count of trades where Profit < 0

Interpretation:

  • Used to calculate win rate
  • Lower is better, but losses are inevitable
  • Must be balanced with average loss size

Example:

Total Trades: 100
Winning Trades: 55
Losing Trades: 45

Total Profit

Description: The sum of all profits from winning trades.

Formula:

Total Profit = Σ (Profit from each winning trade)

Interpretation:

  • Gross profit before losses
  • Used to calculate profit factor
  • Should significantly exceed total loss

Example:

Trade 1: +₹500
Trade 2: +₹750
Trade 3: +₹300
Trade 4: +₹1,200
Total Profit = ₹2,750

Total Loss

Description: The sum of all losses from losing trades (absolute value).

Formula:

Total Loss = Σ |Loss from each losing trade|

Interpretation:

  • Gross loss (positive number)
  • Used to calculate profit factor
  • Should be significantly less than total profit

Example:

Trade 1: -₹400
Trade 2: -₹300
Trade 3: -₹250
Total Loss = ₹950

Win Rate

Description: The percentage of trades that were profitable.

Formula:

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

Interpretation:

Win RateStrategy TypeCharacteristics
< 30%PoorNeeds improvement
30-40%AcceptableLarge wins required
40-50%GoodTypical for swing trading
50-60%Very GoodTypical for day trading
60-70%ExcellentTypical for scalping
> 70%OutstandingRare, verify not curve-fitted

Example:

Winning Trades: 55
Total Trades: 100
Win Rate = (55 / 100) × 100 = 55%

Strategy-Specific Targets:

  • Scalping: 60-70% (tight stops, small wins)
  • Day Trading: 50-60% (balanced approach)
  • Swing Trading: 40-50% (wider stops, larger wins)
  • Position Trading: 30-40% (very wide stops, very large wins)

Profit Factor

Description: The ratio of total profit to total loss. Measures how much you make for every rupee you lose.

Formula:

Profit Factor = Total Profit / Total Loss

Interpretation:

Profit FactorRatingMeaning
< 1.0LosingStrategy loses money
1.0 - 1.25PoorBarely profitable
1.25 - 1.5AcceptableMarginally profitable
1.5 - 2.0GoodSolid strategy
2.0 - 3.0Very GoodExcellent strategy
> 3.0OutstandingExceptional (verify not overfitted)

Example:

Total Profit: ₹50,000
Total Loss: ₹25,000
Profit Factor = 50,000 / 25,000 = 2.0

Interpretation: For every ₹1 lost, the strategy makes ₹2 in profit.

Minimum Targets:

  • Live Trading: > 1.5
  • Backtesting: > 2.0 (accounts for slippage/costs)

Sharpe Ratio

Description: Risk-adjusted return metric. Measures excess return per unit of risk (volatility).

Formula:

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

Simplified Formula (for trading):

Sharpe Ratio = (Average Trade Return) / (Standard Deviation of Trade Returns)

Interpretation:

Sharpe RatioRatingMeaning
< 0PoorLosing money
0 - 0.5SuboptimalHigh risk for return
0.5 - 1.0AcceptableModerate risk-adjusted return
1.0 - 2.0GoodGood risk-adjusted return
2.0 - 3.0Very GoodExcellent risk-adjusted return
> 3.0OutstandingExceptional (rare)

Example:

Average Trade Return: 2%
Standard Deviation: 1.5%
Risk-Free Rate: 0.1% (negligible)

Sharpe Ratio = (2% - 0.1%) / 1.5% = 1.27

Interpretation: Good risk-adjusted returns. For every unit of risk, you get 1.27 units of return.

Minimum Targets:

  • Live Trading: > 1.0
  • Backtesting: > 1.5

Maximum Drawdown

Description: The largest peak-to-trough decline in account equity. Measures worst-case loss.

Formula:

Max Drawdown = (Trough Value - Peak Value) / Peak Value × 100

Interpretation:

Max DrawdownRatingRisk Level
0-5%ExcellentVery low risk
5-10%GoodLow risk
10-20%AcceptableModerate risk
20-30%HighHigh risk
30-50%Very HighVery high risk
> 50%ExtremeUnacceptable

Example:

Peak Equity: ₹100,000
Trough Equity: ₹85,000
Max Drawdown = (85,000 - 100,000) / 100,000 × 100 = -15%

Interpretation: At worst, the strategy lost 15% from its peak.

Acceptable Levels:

  • Conservative: < 10%
  • Moderate: 10-20%
  • Aggressive: 20-30%
  • Very Aggressive: > 30%

Recovery Time:

  • 10% drawdown requires 11.1% gain to recover
  • 20% drawdown requires 25% gain to recover
  • 30% drawdown requires 42.9% gain to recover
  • 50% drawdown requires 100% gain to recover

Average Win

Description: The average profit per winning trade.

Formula:

Average Win = Total Profit / Winning Trades

Interpretation:

  • Should be significantly larger than average loss
  • Higher is better
  • Compare with average loss for risk-reward ratio

Example:

Total Profit: ₹50,000
Winning Trades: 55
Average Win = 50,000 / 55 = ₹909

Use Cases:

  • Calculate risk-reward ratio
  • Set realistic profit targets
  • Compare strategies

Average Loss

Description: The average loss per losing trade (absolute value).

Formula:

Average Loss = Total Loss / Losing Trades

Interpretation:

  • Should be significantly smaller than average win
  • Lower is better
  • Used to calculate risk-reward ratio

Example:

Total Loss: ₹25,000
Losing Trades: 45
Average Loss = 25,000 / 45 = ₹556

Use Cases:

  • Calculate risk-reward ratio
  • Set appropriate stop losses
  • Manage risk per trade

Derived Metrics

Net Profit

Description: Total profit minus total loss.

Formula:

Net Profit = Total Profit - Total Loss

Example:

Total Profit: ₹50,000
Total Loss: ₹25,000
Net Profit = 50,000 - 25,000 = ₹25,000

Risk-Reward Ratio

Description: The ratio of average win to average loss.

Formula:

Risk-Reward Ratio = Average Win / Average Loss

Interpretation:

RatioRatingMeaning
< 1:1PoorLosses larger than wins
1:1 - 1.5:1AcceptableBalanced
1.5:1 - 2:1GoodWins 1.5-2x losses
2:1 - 3:1Very GoodWins 2-3x losses
> 3:1ExcellentWins 3x+ losses

Example:

Average Win: ₹909
Average Loss: ₹556
Risk-Reward = 909 / 556 = 1.63:1

Interpretation: On average, wins are 1.63 times larger than losses.

Relationship with Win Rate:

  • High win rate (60%+) → Can have lower R:R (1:1 to 1.5:1)
  • Low win rate (40%-) → Needs higher R:R (2:1 to 3:1+)

Return on Investment (ROI)

Description: Percentage return on initial capital.

Formula:

ROI = (Net Profit / Initial Capital) × 100

Example:

Initial Capital: ₹100,000
Net Profit: ₹25,000
ROI = (25,000 / 100,000) × 100 = 25%

Expectancy

Description: Average amount you can expect to win (or lose) per trade.

Formula:

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

Example:

Win Rate: 55%
Average Win: ₹909
Loss Rate: 45%
Average Loss: ₹556

Expectancy = (0.55 × 909) - (0.45 × 556)
= 500 - 250
= ₹250 per trade

Interpretation:

  • Positive expectancy = Profitable strategy
  • Higher is better
  • Must be positive for long-term profitability

Metric Relationships

Win Rate vs Profit Factor

High Win Rate (60%+) + Low Profit Factor (1.5) = Scalping
Medium Win Rate (50%) + Medium Profit Factor (2.0) = Day Trading
Low Win Rate (40%) + High Profit Factor (3.0+) = Swing Trading

Win Rate vs Risk-Reward

Win Rate × Average Win = Loss Rate × Average Loss (breakeven)

If Win Rate = 40%:
Need R:R > 1.5:1 to be profitable

If Win Rate = 60%:
Can use R:R = 1:1 and still be profitable

Sharpe Ratio vs Max Drawdown

High Sharpe (2.0+) + Low Drawdown (10%) = Excellent strategy
Medium Sharpe (1.5) + Medium Drawdown (15%) = Good strategy
Low Sharpe (1.0) + High Drawdown (25%) = Risky strategy

Metric Targets by Strategy Type

Scalping

MetricTargetNotes
Win Rate60-70%High frequency requires high win rate
Profit Factor1.5-2.0Tight stops, small wins
Sharpe Ratio1.5-2.5Consistent small gains
Max Drawdown5-10%Tight risk management
Risk-Reward1:1 to 1.5:1Small targets
Total Trades500+High frequency

Day Trading

MetricTargetNotes
Win Rate50-60%Balanced approach
Profit Factor1.8-2.5Good risk-reward
Sharpe Ratio1.2-2.0Moderate consistency
Max Drawdown10-15%Moderate risk
Risk-Reward1.5:1 to 2:1Balanced targets
Total Trades200+Moderate frequency

Swing Trading

MetricTargetNotes
Win Rate40-50%Lower frequency, larger wins
Profit Factor2.0-3.0High risk-reward
Sharpe Ratio1.0-1.8Less consistent
Max Drawdown15-25%Higher risk tolerance
Risk-Reward2:1 to 3:1Large targets
Total Trades100+Lower frequency

Position Trading

MetricTargetNotes
Win Rate30-40%Very low frequency, very large wins
Profit Factor2.5-4.0Very high risk-reward
Sharpe Ratio0.8-1.5Inconsistent
Max Drawdown20-30%High risk tolerance
Risk-Reward3:1 to 5:1Very large targets
Total Trades50+Very low frequency

Metric Interpretation Examples

Example 1: Excellent Scalping Strategy

{
"totalTrades": 500,
"winningTrades": 325,
"losingTrades": 175,
"totalProfit": 125000,
"totalLoss": 62500,
"winRate": 65,
"profitFactor": 2.0,
"sharpeRatio": 2.1,
"maxDrawdown": 8,
"averageWin": 385,
"averageLoss": 357
}

Analysis:

  • ✅ High win rate (65%) suitable for scalping
  • ✅ Good profit factor (2.0)
  • ✅ Excellent Sharpe ratio (2.1)
  • ✅ Low drawdown (8%)
  • ✅ Balanced risk-reward (1.08:1)
  • Rating: Excellent scalping strategy

Example 2: Good Swing Trading Strategy

{
"totalTrades": 120,
"winningTrades": 54,
"losingTrades": 66,
"totalProfit": 180000,
"totalLoss": 66000,
"winRate": 45,
"profitFactor": 2.73,
"sharpeRatio": 1.4,
"maxDrawdown": 18,
"averageWin": 3333,
"averageLoss": 1000
}

Analysis:

  • ✅ Acceptable win rate (45%) for swing trading
  • ✅ Excellent profit factor (2.73)
  • ✅ Good Sharpe ratio (1.4)
  • ✅ Acceptable drawdown (18%)
  • ✅ Excellent risk-reward (3.33:1)
  • Rating: Excellent swing trading strategy

Example 3: Poor Strategy (Needs Improvement)

{
"totalTrades": 80,
"winningTrades": 35,
"losingTrades": 45,
"totalProfit": 40000,
"totalLoss": 45000,
"winRate": 44,
"profitFactor": 0.89,
"sharpeRatio": -0.3,
"maxDrawdown": 35,
"averageWin": 1143,
"averageLoss": 1000
}

Analysis:

  • ❌ Profit factor < 1.0 (losing money)
  • ❌ Negative Sharpe ratio
  • ❌ High drawdown (35%)
  • ❌ Poor risk-reward (1.14:1) for 44% win rate
  • Rating: Losing strategy, needs major improvements

Monitoring Performance

Real-Time Tracking

GET /api/algorithms/:id/performance

Response:
{
"performance": {
"totalTrades": 150,
"winRate": 52,
"profitFactor": 1.85,
"sharpeRatio": 1.3,
"maxDrawdown": 12,
"netProfit": 25000,
"roi": 25
},
"lastUpdated": "2024-11-09T10:30:00Z"
}

Performance Alerts

Set alerts for key metrics:

{
"alerts": {
"maxDrawdown": {
"threshold": 15,
"action": "pause_algorithm"
},
"profitFactor": {
"threshold": 1.2,
"action": "send_notification"
},
"winRate": {
"threshold": 40,
"action": "send_notification"
}
}
}

Best Practices

1. Track Multiple Metrics

Don't rely on a single metric:

  • Win rate alone can be misleading
  • Profit factor without drawdown is incomplete
  • Always consider risk-adjusted returns (Sharpe)

2. Compare Against Benchmarks

Your Strategy vs Buy & Hold:
- Your Sharpe: 1.5
- Buy & Hold Sharpe: 0.8
- Outperformance: 87.5%

3. Monitor Drawdown Closely

If Max Drawdown > 20%:
- Reduce position sizes
- Tighten stops
- Review strategy logic

4. Ensure Statistical Significance

Minimum Trades Required:
- Scalping: 500+
- Day Trading: 200+
- Swing Trading: 100+
- Position Trading: 50+

5. Track Metrics Over Time

Monthly Performance:
Jan: Profit Factor 2.1, Sharpe 1.5
Feb: Profit Factor 1.9, Sharpe 1.4
Mar: Profit Factor 2.3, Sharpe 1.6

Trend: Consistent performance ✓

Common Mistakes

  1. Focusing only on win rate - High win rate with poor risk-reward can lose money
  2. Ignoring drawdown - High returns with 50% drawdown is unacceptable
  3. Not enough trades - 20 trades is not statistically significant
  4. Comparing different timeframes - Scalping vs swing metrics are different
  5. Ignoring transaction costs - Backtest profit factor should be > 2.0 to account for costs