Positive Expectancy: The Mathematical Foundation of Profitable Trading
Master the mathematical foundation that separates consistently profitable traders from those who leave success to chance.
Calculate Edge
Quantify your statistical advantage
Optimize Returns
Maximize long-term profitability
Track Performance
Monitor expectancy over time
The Core Formula
Understanding Positive Expectancy in Trading
Positive expectancy is the single most important concept in trading. It represents the average amount you can expect to win or lose per trade over the long term. Without positive expectancy, no amount of discipline, capital, or market knowledge will make you consistently profitable. This lesson reveals how to calculate, optimize, and maintain positive expectancy in your trading strategies.
What Is Trading Expectancy?
Trading expectancy (also called expected value or mathematical expectation) is the average amount you can expect to make or lose per trade, based on your historical performance. It combines your win rate, average win size, and average loss size into a single metric that predicts long-term profitability.
Expectancy Formula:
A positive expectancy means you make money on average per trade. A negative expectancy means you lose money on average per trade, guaranteeing eventual failure regardless of short-term wins.
Why Expectancy Trumps Win Rate
Many traders obsess over win rate, but expectancy reveals a critical truth: you can be profitable with a low win rate, and unprofitable with a high win rate. What matters is the relationship between your wins and losses.
Example 1: High Win Rate, Negative Expectancy
Trader A wins 70% of trades with an average win of $50, but loses $200 on average when wrong.
E = (0.70 × $50) - (0.30 × $200) = $35 - $60 = -$25
Despite winning 7 out of 10 trades, Trader A loses $25 per trade on average.
Example 2: Low Win Rate, Positive Expectancy
Trader B wins only 40% of trades but averages $300 per win and $100 per loss.
E = (0.40 × $300) - (0.60 × $100) = $120 - $60 = +$60
Despite losing 6 out of 10 trades, Trader B makes $60 per trade on average.
This demonstrates why professional traders focus on risk-reward ratios and cutting losses quickly, rather than maximizing win rate.
The Three Paths to Positive Expectancy
There are only three ways to achieve positive expectancy in trading:
1 High Win Rate + Modest Risk-Reward
Win 60-70%+ of trades with wins slightly larger than losses (1.2:1 to 1.5:1 ratio).
Common in mean reversion and range trading strategies.
2 Moderate Win Rate + Strong Risk-Reward
Win 45-55% of trades but capture 2:1 to 3:1 risk-reward ratios.
The balanced approach used by most professional discretionary traders.
3 Low Win Rate + Exceptional Risk-Reward
Win 30-40% of trades but achieve 3:1, 5:1, or even 10:1 winners.
Characteristic of trend following and breakout strategies.
Calculating Expectancy for Your EA
Here's a practical MQL5 implementation to calculate trading expectancy from your EA's performance:
struct ExpectancyResult
{
double expectancy;
double winRate;
double lossRate;
double avgWin;
double avgLoss;
double rewardRiskRatio;
int totalTrades;
int winningTrades;
int losingTrades;
};
ExpectancyResult CalculateExpectancy()
{
ExpectancyResult result;
// Initialize variables
double totalWins = 0.0, totalLosses = 0.0;
int wins = 0, losses = 0;
// Get total number of closed trades from history
HistorySelect(0, TimeCurrent());
int totalDeals = HistoryDealsTotal();
for(int i = 0; i < totalDeals; i++)
{
ulong ticket = HistoryDealGetTicket(i);
if(ticket > 0)
{
// Get deal profit
double profit = HistoryDealGetDouble(ticket, DEAL_PROFIT);
// Only count actual trading profits (exclude swaps/commissions for simplicity)
if(HistoryDealGetInteger(ticket, DEAL_ENTRY) == DEAL_ENTRY_OUT)
{
if(profit > 0)
{
totalWins += profit;
wins++;
}
else if(profit < 0)
{
totalLosses += MathAbs(profit);
losses++;
}
}
}
}
// Calculate metrics
result.totalTrades = wins + losses;
result.winningTrades = wins;
result.losingTrades = losses;
if(result.totalTrades == 0)
{
Print("No trades found in history.");
return result;
}
result.winRate = (double)wins / result.totalTrades;
result.lossRate = (double)losses / result.totalTrades;
result.avgWin = wins > 0 ? totalWins / wins : 0.0;
result.avgLoss = losses > 0 ? totalLosses / losses : 0.0;
result.rewardRiskRatio = result.avgLoss > 0 ? result.avgWin / result.avgLoss : 0.0;
// Calculate expectancy
result.expectancy = (result.winRate * result.avgWin) - (result.lossRate * result.avgLoss);
return result;
}
void OnStart()
{
ExpectancyResult result = CalculateExpectancy();
Print("=== EXPECTANCY ANALYSIS ===");
Print("Total Trades: ", result.totalTrades);
Print("Winning Trades: ", result.winningTrades, " (", DoubleToString(result.winRate * 100, 1), "%)");
Print("Losing Trades: ", result.losingTrades, " (", DoubleToString(result.lossRate * 100, 1), "%)");
Print("Average Win: $", DoubleToString(result.avgWin, 2));
Print("Average Loss: $", DoubleToString(result.avgLoss, 2));
Print("Reward:Risk Ratio: ", DoubleToString(result.rewardRiskRatio, 2), ":1");
Print("Expectancy per Trade: $", DoubleToString(result.expectancy, 2));
// Interpret expectancy
string interpretation = "";
if(result.expectancy <= 0)
interpretation = "NEGATIVE - Strategy is not profitable";
else if(result.expectancy < 10)
interpretation = "LOW POSITIVE - Marginal profitability";
else if(result.expectancy < 50)
interpretation = "MODERATE POSITIVE - Decent profitability";
else if(result.expectancy < 100)
interpretation = "STRONG POSITIVE - Good profitability";
else
interpretation = "EXCELLENT POSITIVE - Outstanding profitability";
Print("Interpretation: ", interpretation);
// Calculate expected profit over next 100 trades
double expectedProfit100 = result.expectancy * 100;
Print("Expected profit over next 100 trades: $", DoubleToString(expectedProfit100, 2));
}
Optimizing Your Trading Expectancy
Once you understand your current expectancy, you can systematically improve it through these proven methods:
1. Improve Your Risk-Reward Ratio
The easiest way to boost expectancy is to target larger wins relative to losses. Aim for minimum 1.5:1, ideally 2:1 or higher.
- Place stop losses at logical technical levels, not arbitrary distances
- Let winners run to significant support/resistance levels
- Use trailing stops to capture extended moves
- Scale out of positions to lock in profits while letting remainder run
2. Cut Losses Faster
Reducing your average loss size has an immediate impact on expectancy. Every dollar saved on losing trades adds directly to your bottom line.
- Exit immediately when your entry thesis is invalidated
- Use tight stops on lower-probability setups
- Avoid averaging down on losing positions
- Set maximum loss limits per trade (typically 1-2% of capital)
3. Increase Win Rate Through Better Entries
Improve your edge by trading only the highest-probability setups that meet all your criteria.
- Wait for multiple confirming signals before entry
- Trade with the trend, not against it
- Enter at optimal points (pullbacks in trends, extreme RSI levels, etc.)
- Avoid low-probability trades out of boredom or overconfidence
4. Filter Out Low-Expectancy Conditions
Not all market conditions are equally profitable. Identify and avoid periods where your strategy underperforms.
- Avoid trading during low-volume periods (early Asian session for forex)
- Stay out during major news events if your strategy is directional
- Recognize when market regime has changed (trending vs ranging)
- Track expectancy by day of week, time of day, and market conditions
Practical Example: Comparing Two Strategies
Let's analyze two different trading approaches to see which offers better expectancy:
| Metric | Strategy A: Scalping | Strategy B: Swing Trading |
|---|---|---|
| Win Rate | 65% | 42% |
| Average Win | $25 | $180 |
| Average Loss | $20 | $75 |
| Risk:Reward Ratio | 1.25:1 | 2.4:1 |
| Expectancy | $9.25 | $32.10 |
| Expected Profit (100 trades) | $925 | $3,210 |
Analysis:
Strategy A Calculation: (0.65 × $25) - (0.35 × $20) = $16.25 - $7.00 = $9.25 per trade
Strategy B Calculation: (0.42 × $180) - (0.58 × $75) = $75.60 - $43.50 = $32.10 per trade
Despite Strategy A having a much higher win rate (65% vs 42%), Strategy B has 3.5x better expectancy due to its superior risk-reward ratio. Over 100 trades, Strategy B would generate $2,285 more profit.
Monitoring Expectancy Over Time
Expectancy is not a static metric—it changes as market conditions evolve and your strategy adapts. Implement continuous monitoring:
input int MonitoringPeriod = 50; // Calculate expectancy over last N trades
class ExpectancyMonitor
{
private:
double m_recentExpectancy[];
datetime m_updateTime[];
public:
void UpdateExpectancy()
{
ExpectancyResult current = CalculateExpectancyForLastNTrades(MonitoringPeriod);
// Store result
int size = ArraySize(m_recentExpectancy);
ArrayResize(m_recentExpectancy, size + 1);
ArrayResize(m_updateTime, size + 1);
m_recentExpectancy[size] = current.expectancy;
m_updateTime[size] = TimeCurrent();
// Alert if expectancy drops below threshold
if(current.expectancy < 5.0 && current.totalTrades >= MonitoringPeriod)
{
Alert("WARNING: Expectancy has dropped to $", DoubleToString(current.expectancy, 2),
" - Review strategy performance!");
}
// Check for deteriorating trend
if(size >= 5)
{
double recentAvg = (m_recentExpectancy[size] + m_recentExpectancy[size-1] +
m_recentExpectancy[size-2]) / 3.0;
double olderAvg = (m_recentExpectancy[size-3] + m_recentExpectancy[size-4] +
m_recentExpectancy[size-5]) / 3.0;
if(recentAvg < olderAvg * 0.7) // 30% decline
{
Alert("CAUTION: Expectancy trending downward - Recent: $",
DoubleToString(recentAvg, 2), " vs Previous: $",
DoubleToString(olderAvg, 2));
}
}
}
void DisplayDashboard()
{
ExpectancyResult current = CalculateExpectancyForLastNTrades(MonitoringPeriod);
Comment(
"\n╔════════════════════════════════════╗",
"\n║ EXPECTANCY MONITOR DASHBOARD ║",
"\n╠════════════════════════════════════╣",
"\n║ Monitoring Period: ", MonitoringPeriod, " trades ║",
"\n║ Current Expectancy: $", DoubleToString(current.expectancy, 2), " ║",
"\n║ Win Rate: ", DoubleToString(current.winRate * 100, 1), "% ║",
"\n║ Avg Win: $", DoubleToString(current.avgWin, 2), " ║",
"\n║ Avg Loss: $", DoubleToString(current.avgLoss, 2), " ║",
"\n║ R:R Ratio: ", DoubleToString(current.rewardRiskRatio, 2), ":1 ║",
"\n║ ║",
"\n║ Expected P/L (next 10): $", DoubleToString(current.expectancy * 10, 2), " ║",
"\n║ Expected P/L (next 100): $", DoubleToString(current.expectancy * 100, 0), " ║",
"\n╚════════════════════════════════════╝"
);
}
};
ExpectancyMonitor g_monitor;
void OnTrade()
{
// Update expectancy after each trade
g_monitor.UpdateExpectancy();
}
void OnTimer()
{
// Update dashboard every minute
g_monitor.DisplayDashboard();
}
Common Expectancy Mistakes to Avoid
Mistake #1: Calculating on Too Few Trades
Expectancy calculated from 10-20 trades is statistically meaningless. Use at least 30-50 trades, preferably 100+, for reliable results.
Mistake #2: Ignoring Commissions and Slippage
Always include spreads, commissions, and slippage in your calculations. A strategy with $15 gross expectancy might have only $8 net expectancy after costs.
Mistake #3: Not Adjusting for Position Size
Express expectancy as a percentage of risk or in R-multiples, not just dollar amounts, so it scales with your account size.
Mistake #4: Forgetting Market Regime Changes
A strategy's expectancy in trending markets may be completely different from ranging markets. Calculate separately for different conditions.
The Power of Compounding Positive Expectancy
The true magic of positive expectancy becomes apparent over hundreds of trades. Let's see the dramatic difference between strategies:
Strategy with +$15 Expectancy
After 100 trades: +$1,500
After 500 trades: +$7,500
After 1,000 trades: +$15,000
Strategy with -$5 Expectancy
After 100 trades: -$500
After 500 trades: -$2,500
After 1,000 trades: -$5,000
This demonstrates why professionals obsess over expectancy: the law of large numbers guarantees that your long-term results will converge to your expectancy. A trader with positive expectancy cannot lose over sufficient sample size, while a trader with negative expectancy cannot win.
Key Takeaways
-
Expectancy = (Win Rate × Avg Win) - (Loss Rate × Avg Loss) is your most important metric
-
Positive expectancy is mandatory for long-term profitability—there are no exceptions
-
You can achieve positive expectancy with any win rate if your risk-reward ratio compensates
-
Calculate expectancy over at least 50-100 trades for statistical reliability
-
Monitor expectancy continuously—deteriorating expectancy signals strategy adaptation is needed
-
Improve expectancy by increasing risk-reward ratios, cutting losses faster, or filtering trades
"In trading, your expectancy is your destiny. Master this one metric, and profitability becomes a mathematical certainty rather than hopeful speculation."