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 Rate | Strategy Type | Characteristics |
|---|---|---|
| < 30% | Poor | Needs improvement |
| 30-40% | Acceptable | Large wins required |
| 40-50% | Good | Typical for swing trading |
| 50-60% | Very Good | Typical for day trading |
| 60-70% | Excellent | Typical for scalping |
| > 70% | Outstanding | Rare, 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 Factor | Rating | Meaning |
|---|---|---|
| < 1.0 | Losing | Strategy loses money |
| 1.0 - 1.25 | Poor | Barely profitable |
| 1.25 - 1.5 | Acceptable | Marginally profitable |
| 1.5 - 2.0 | Good | Solid strategy |
| 2.0 - 3.0 | Very Good | Excellent strategy |
| > 3.0 | Outstanding | Exceptional (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 Ratio | Rating | Meaning |
|---|---|---|
| < 0 | Poor | Losing money |
| 0 - 0.5 | Suboptimal | High risk for return |
| 0.5 - 1.0 | Acceptable | Moderate risk-adjusted return |
| 1.0 - 2.0 | Good | Good risk-adjusted return |
| 2.0 - 3.0 | Very Good | Excellent risk-adjusted return |
| > 3.0 | Outstanding | Exceptional (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 Drawdown | Rating | Risk Level |
|---|---|---|
| 0-5% | Excellent | Very low risk |
| 5-10% | Good | Low risk |
| 10-20% | Acceptable | Moderate risk |
| 20-30% | High | High risk |
| 30-50% | Very High | Very high risk |
| > 50% | Extreme | Unacceptable |
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:
| Ratio | Rating | Meaning |
|---|---|---|
| < 1:1 | Poor | Losses larger than wins |
| 1:1 - 1.5:1 | Acceptable | Balanced |
| 1.5:1 - 2:1 | Good | Wins 1.5-2x losses |
| 2:1 - 3:1 | Very Good | Wins 2-3x losses |
| > 3:1 | Excellent | Wins 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
| Metric | Target | Notes |
|---|---|---|
| Win Rate | 60-70% | High frequency requires high win rate |
| Profit Factor | 1.5-2.0 | Tight stops, small wins |
| Sharpe Ratio | 1.5-2.5 | Consistent small gains |
| Max Drawdown | 5-10% | Tight risk management |
| Risk-Reward | 1:1 to 1.5:1 | Small targets |
| Total Trades | 500+ | High frequency |
Day Trading
| Metric | Target | Notes |
|---|---|---|
| Win Rate | 50-60% | Balanced approach |
| Profit Factor | 1.8-2.5 | Good risk-reward |
| Sharpe Ratio | 1.2-2.0 | Moderate consistency |
| Max Drawdown | 10-15% | Moderate risk |
| Risk-Reward | 1.5:1 to 2:1 | Balanced targets |
| Total Trades | 200+ | Moderate frequency |
Swing Trading
| Metric | Target | Notes |
|---|---|---|
| Win Rate | 40-50% | Lower frequency, larger wins |
| Profit Factor | 2.0-3.0 | High risk-reward |
| Sharpe Ratio | 1.0-1.8 | Less consistent |
| Max Drawdown | 15-25% | Higher risk tolerance |
| Risk-Reward | 2:1 to 3:1 | Large targets |
| Total Trades | 100+ | Lower frequency |
Position Trading
| Metric | Target | Notes |
|---|---|---|
| Win Rate | 30-40% | Very low frequency, very large wins |
| Profit Factor | 2.5-4.0 | Very high risk-reward |
| Sharpe Ratio | 0.8-1.5 | Inconsistent |
| Max Drawdown | 20-30% | High risk tolerance |
| Risk-Reward | 3:1 to 5:1 | Very large targets |
| Total Trades | 50+ | 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
- Focusing only on win rate - High win rate with poor risk-reward can lose money
- Ignoring drawdown - High returns with 50% drawdown is unacceptable
- Not enough trades - 20 trades is not statistically significant
- Comparing different timeframes - Scalping vs swing metrics are different
- Ignoring transaction costs - Backtest profit factor should be > 2.0 to account for costs