Nov 22
A Harder-to-Fool Profit Factor: Timothy Masters' Internal Profit Factor
Profit factor is the number everyone reaches for first. Ask any strategy developer which single figure matters most and a great many will name it without hesitation — it is the ratio that gets quoted first, the column every screening table sorts by, the figure I check within seconds of a new backtest finishing. Its appeal is easy to understand: one division, one number, comparable across any two strategies regardless of instrument, timeframe, or how many trades they took.
That simplicity is also where the trouble starts. Profit factor only ever looks at where a trade started and where it ended. It has no opinion about what happened in between — and “in between” is where most of a trade’s real character lives. A strategy can be dragged to an excellent-looking number by one or two enormous winners while the rest of its trades barely cover their own costs, and the ratio will never tell you which kind of strategy you are looking at.
This is not a niche concern. Anyone who tests more than a handful of strategies is, whether they realise it or not, running a search process — trying parameter sets, rule variants, or entirely different logic, and keeping whatever scores best on whatever metric is doing the ranking. Profit factor is very often that metric, because it is the one every report already shows. The trouble is that a search process is relentless about finding whatever the scoring function rewards, including ways of scoring well that have nothing to do with a genuine edge.
A trade-level metric
The standard definition is unremarkable: profit factor is gross profit divided by gross loss, summed across every trade in the test. Take a strategy with $149,020 in gross profit against $75,215 in gross loss, and you get a profit factor of 1.98 — comfortably above break-even, the kind of number that gets a strategy shortlisted rather than deleted.
There is nothing wrong with that arithmetic. It is standardised, cheap to compute, and directly comparable across a whole population of candidate strategies, which is exactly why it became the default. But notice what it is blind to. It treats every winning trade as one number — its final profit — and every losing trade the same way. A trade that shot straight up and closed near its high counts exactly the same as a trade that spent most of its life underwater, recovered late, and closed only marginally green. Both contribute an identical figure to gross profit. The ratio cannot distinguish them, because it was never given the information to.
That blindness matters more than it looks. A strategy can be carried almost entirely by a small number of outsized winners, with the rest of its trades doing little more than covering commissions and slippage. Its profit factor on the whole set can still look excellent — 1.98, or better — right up until the strategy goes live without the benefit of that one lucky trade repeating.
The view from inside a trade
Step back and the problem is really about where a metric chooses to look. A trade-level metric takes the outside view: it sees a trade the way a bank statement does, as an entry price and an exit price, with everything between them collapsed into a single number. It is possible to take the inside view instead — to look at what the position actually experienced, bar by bar, while it was open. That is a harder number to compute and a much harder one to game, because it cannot be satisfied by a good ending alone; it has to be earned the whole way through.
This is the exact problem Timothy Masters addresses in his book on statistically sound indicators for financial-market prediction. His proposed fix — the internal profit factor — keeps the same ratio, gross profit over gross loss, but changes what gets fed into it.
Timothy Masters’ internal profit factor
Instead of treating a trade as a single before-and-after number, Masters decomposes it into its bar-by-bar returns. Take a position that is opened and held for five bars before being closed. A trade-level metric sees one outcome: the difference between the entry price and the exit price. The internal profit factor sees five outcomes instead — the bar-to-bar change for each of the five bars the position was open:
- Internal gross profit: the sum of every bar-to-bar move that went in the position’s favour while it was open.
- Internal gross loss: the sum of every bar-to-bar move that went against it.
Divide one by the other and you have the internal profit factor: the same ratio as the standard one, computed on a completely different, much finer set of observations.
The effect is immediate once you picture it. A trade that closes green after spending most of its five bars moving against the position still racks up plenty of internal loss along the way — the internal profit factor sees the struggle that the trade-level number quietly discards. A trade that moves steadily in the position’s favour across all five bars contributes almost pure internal profit, even if its final result, in isolation, looks unremarkable. The question the metric asks has changed. It has stopped asking “did this trade make money?” and started asking “was this trade comfortable for the whole time it was open?”
Picture two trades that both take five bars to play out and both close at roughly the same final profit. In the first, all five bars move steadily in the position’s favour — the trade is comfortable from the moment it opens. In the second, the first four bars move hard against the position and only the fifth bar recovers everything at once. A trade-level metric cannot tell these apart; both hand it much the same final number. The internal profit factor separates them immediately, because it saw the four uncomfortable bars in the second trade and counted them as internal loss. Only one of these two trades is the kind of edge I want to trust with size.
Why it is harder to fool
Two things follow from measuring bars instead of trades, and both make the internal profit factor a sturdier number to lean on than its trade-level parent.
The first is that it measures the quality of the path, not just the endpoints. A strategy that wins mostly through trades that spend their life deep underwater before a late recovery has a real, specific weakness — it is one bad exit, one gap, one broker hiccup away from converting those recoveries into losses. The standard profit factor cannot see that weakness, because it never looks past the entry and exit prices. The internal profit factor sees every bar in between, so it penalises the ugly path even when the trade technically won, and rewards the strategy whose trades move cleanly and immediately in its favour. As a side effect, it is also a useful lens on trade management itself — a system that habitually gives back an open profit before finally closing green will show that cost internally, even though the trade-level number reports nothing but a win.
The second reason is purely statistical. A trade-level profit factor is built from one observation per trade, and a handful of outsized trades can dominate the sum on either side of the ratio. Decompose those same trades into their bars and the number of observations multiplies many times over — every bar a position was held for becomes its own data point. A ratio built on that much finer a set of observations is far less sensitive to any single one of them than a ratio built on whole trades. That is precisely why it is harder to fool: fooling a trade-level profit factor takes one lucky trade; fooling its internal counterpart takes a strategy that is genuinely comfortable, bar after bar, for as long as it holds a position.
How I use it
Where this earns its keep is at scale. When I am generating and evaluating large populations of candidate strategies in StrategyQuant X, the standard profit factor is doing a lot of the early sorting — it is cheap to compute and a reasonable first filter across thousands of candidates. But rank thousands of generated strategies purely by trade-level profit factor and, without quite meaning to, you are running a search for strategies that got lucky on a handful of trades. Optimisation is very good at finding those; it has no opinion on whether the result was skill or noise, only on whether the number went up.
I use the internal profit factor as a second pass over whatever the first filter leaves behind, reading the two numbers together rather than either one alone:
- Strong trade-level, weak internal: the strategy wins on paper, but its trades spend much of their life fighting the position before resolving well — a warning sign, not a pass.
- Strong on both: the strategy wins and does so comfortably, bar after bar — the combination I am actually looking for.
I do not treat a weak internal number as an automatic disqualifier, though: a legitimate trend-following trade can spend several bars pulling back before it runs, and an internal profit factor that ignores that context can quietly penalise a perfectly healthy strategy. It works best alongside the standard profit factor, not instead of it.
This slots naturally alongside the other checks I already run before trusting a strategy — walk-forward analysis, out-of-sample testing, robustness and Monte Carlo work. None of those replace the others; each is a different lens on the same underlying question, which is whether an edge is real or merely well-fitted to the past. The internal profit factor’s contribution to that stack is narrow but specific: it is the one check that looks inside the trade itself, rather than across trades or across time.
The point
Every performance metric is a lens, and the lens you choose decides what you find. Rank a population of strategies on a number that can be flattered by a few lucky trades, and optimisation will hand you exactly that — strategies that are lucky, dressed up as strategies that are good. The internal profit factor is valuable not because it replaces the standard one, but because it is a far harder number to fool: it draws on the full texture of a trade rather than its two endpoints, and it takes a great many favourable bars, not one favourable trade, to earn a high score. How you measure a strategy quietly determines what you end up selecting. Measure carelessly, at scale, and you will breed fragility without ever intending to.
If you would like a second opinion on which of your metrics are actually earning their keep, that is something I can help with.