Profit Factor: Formula, Meaning and 70 Real Backtests
Profit factor is a trading system's gross profit divided by its gross loss: the money made on all winning trades over the money lost on all losing ones. A value above 1.0 means the system made money overall across the trades counted, below 1.0 means it lost, and exactly 1.0 means the two sides were equal.
Profit factor is one of the first numbers a backtest report shows, and one of the most quoted. It compresses a whole list of trades into a single ratio, which makes it easy to compare two strategies and just as easy to compare them badly.
This page defines it, works one through by hand, and then measures how much it moves in real tests: 70 TradingView backtests on seven large stocks, and one long list of SPY trades resampled 10,000 times.
How it works
Add up every winning trade, add up every losing trade, and divide. MetaTrader 5’s testing report defines gross profit as the sum of all profitable trades, gross loss as the sum of all losing trades, and profit factor as the ratio of the first to the second, adding that a value of one means the two are equal.
Profit factor = gross profit / gross loss, with the loss taken as a positive number.
It is the product of two ratios. Gross profit is the number of winning trades times the average win; gross loss is the number of losing trades times the average loss. So a profit factor of 2.0 can come from twice as many winners as losers of the same size, or the same number of each with winners twice as large. The ratio alone does not say which.
It links directly to expectancy. Net profit is gross profit minus gross loss, and expectancy is that net divided by the number of trades. A profit factor above 1.0 and a positive expectancy are the same statement about the same trades.
The costs have to be inside it. A profit factor computed on raw price moves is higher than one computed after commission and slippage, because every cost shrinks a winner and deepens a loser. The strategy tester on most platforms applies the costs you set, so the figure is only as realistic as those settings.
A worked example
Take a hypothetical list of 20 trades on a $10,000 account. 8 trades make money, totaling $2,400. 12 trades lose money, totaling $1,800.
- Profit factor = $2,400 / $1,800 = 1.33.
- Net profit = $2,400 - $1,800 = $600, or $30 a trade on average.
Now add $10 of cost to every trade, commission and slippage together. The 8 winners shrink by $80 to $2,320, and the 12 losers grow by $120 to $1,920.
- Profit factor = $2,320 / $1,920 = 1.21.
- Net profit = $400, or $20 a trade.
A cost equal to a third of the average net result per trade cut the profit factor by about 9%. On a system with a thinner edge, the same cost could take it below 1.0.
The original data
70 backtests from TradingView’s Strategy Tester, one run for each of 10 swing rules on each of seven stocks (Apple, Amazon, Alphabet, Meta, Microsoft, Nvidia and Tesla), on daily bars from January 2015 to August 2026, long only, with 0.05% commission and one tick of slippage. The tester reports profit factor on each run’s dollar results.
3 of the 70 runs had no losing trade, so their profit factor has no finite value. All three used the same rule, an RSI(14) below 30 entry, and took 2 to 6 trades in more than eleven years.
On the other 67, profit factor above 1.0 matched a net gain every time. Six runs came in below 1.0 and all six lost money, from Meta’s Donchian and ATR target rule at 0.987 (-4.29%) to Tesla’s pullback and ATR target rule at 0.580 (-69.0%).
| Profit factor | Runs |
|---|---|
| Below 1.0 | 6 |
| 1.0 to 1.3 | 14 |
| 1.3 to 2.0 | 25 |
| 2.0 to 3.0 | 9 |
| 3.0 and above | 13 |
| No losing trade | 3 |
The median of the 67 was 1.576. But trade count changes the picture. The 15 runs with fewer than 30 trades had a median of 3.370 and ranged from 1.153 to 81.106. The 52 runs with 30 or more had a median of 1.544 and ranged from 0.580 to 3.340. The 81.106 came from Meta on 4 trades. Of the 13 runs at 3.0 and above, 8 had fewer than 30 trades, and so did all 3 runs with no losing trade. Across the six rows of the table, the 52 runs of 30 or more trades split 6, 11, 24, 6, 5 and 0, and the 18 shorter runs 0, 3, 1, 3, 8 and 3.
A high profit factor did not mean a large gain. The rank correlation between profit factor and net result across the 67 runs was only 0.28. The largest gain in the set, +385.79%, came from Nvidia’s five-day-low rule at a profit factor of 2.394 over 61 trades. Every run is in the 70-run table.
How much one number can move
The second test uses one long list: 261 SPY trades from November 1993 to September 2026, from a simple RSI(2) rule (buy at the close when RSI(2) is below 10 and the close is above its 200-day average, sell at the first close above the 5-day average), one equal stake per trade, before costs.
- Gross profit: 249.46 percentage points over 200 trades that closed higher, an average of 1.25 points.
- Gross loss: 81.02 points over 61 trades that closed lower, an average of 1.33 points.
- Profit factor: 249.46 / 81.02 = 3.08.
The losses were slightly larger than the gains on average; the profit factor comes from the count, not the size.
Split in time, it held up but shrank: 3.44 on the first 130 trades (to August 2011) and 2.72 on the last 131. The first 30 trades alone gave 4.28. And taking 0.10 of a percentage point off every trade, about 0.05% each way, cut it to 2.63, turning two small gains into losses.
Then the list was resampled. Drawing 261 trades at random with replacement, 10,000 times, gives a range of profit factors the same trades could have produced in a different order and mix: 2.21 at the 5th percentile, 3.12 at the median and 4.61 at the 95th. None of the 10,000 fell below 1.3.
Drawing only 30 trades at a time from the same list gave 1.27 at the 5th percentile and 12.94 at the 95th, and 177 of the 10,000 samples came in below 1.0. The underlying trades were identical; only the sample size changed. The top of that range is itself unstable: repeating the 10,000 draws with other random seeds moved the 95th percentile between about 13 and 14.5.
The 10,000 values for both sample sizes are in the resample file.
When it fails
It fails on small samples. With few trades, one large winner or the absence of a single loser dominates the ratio. The 4-trade 81.1 and the three runs with no losing trade at all are the extreme cases, and the 30-trade resamples show the same list of trades printing anywhere from about 1.3 to about 13, nine times in ten, on a sample that short.
It hides the order of trades. The same profit factor can come with a smooth equity curve or a long run of losses in the middle. It says nothing about drawdown, which is what decides whether a trader can stick with a system. A Monte Carlo simulation of the same trades shows the spread of drawdowns that order alone can produce.
It ignores size and compounding. Tesla’s trend and ATR target rule finished at 0.933 over 274 trades and lost 51.0%, while Meta’s Donchian and ATR target rule at 0.987 over 154 trades lost 4.29%. Close to 1.0, many trades of full position size and volatile prices turn a small shortfall into a large loss.
It flatters a tuned rule. A rule whose settings were adjusted until the backtest looked best will show a high profit factor on that history almost by construction. That is overfitting, and the check is out-of-sample testing on data the settings never saw.
It is not comparable across definitions. One report computes it on dollars with compounding, another on equal-sized percentage trades, one before costs and one after. The SPY figure above and the TradingView figures are measured differently and should not be ranked against each other.
Related
Expectancy turns the same gross profit and gross loss into an average per trade, and the expectancy calculator does the arithmetic. Backtesting covers how a trade list like these is produced, and the strategy tester page covers the tool that produced the 70 runs.
The RSI(2) strategy looks at one of the rules above in detail, and how often trades pay off is the other half of the profit factor’s arithmetic.
Look at the trade count before the profit factor. Under about 30 trades the number can land almost anywhere, so check how it holds up with costs added and on data the rule was not built on before giving it any weight.
— Michael Whitman
This page is educational, not financial advice. Test every idea on your own charts before risking money.