Flip the Strategy and It Still Loses
Running a losing strategy backwards should print money, and almost never does. Why trading costs have no side, what the flip test really measures, and the checks that tell you whether your backtest is simulating a market or negating a number.
“Then just do the opposite”
A backtest comes back deep in the red. The next thought is almost automatic: fine—do the opposite. Buy where it sold, sell where it bought, collect the mirror image of the loss.
It is a reasonable thought, and it is worth acting on. Just not for the reason most people act on it. Flipping a strategy is rarely a way to find a profitable strategy. It is one of the sharpest tests you can run on your backtest engine, and most engines fail it.
Run it against real recorded order books and the usual outcome is that both directions lose money—on the same days, in the same markets, for the same reason. That is not a bug in the test. An engine that confidently reports otherwise is the thing with the bug.
Why the mirror does not line up
That second panel surprises people, so it is worth slowing down on. The reason the two runs are not opposites is simple once you see it: a resting order does not choose when it trades. It waits, and the market decides whether to come and get it.
Picture a buy order sitting just below the current price, waiting for the price to fall to it. Its mirror is a sell order sitting just above, waiting for the price to rise to it. Those are two different events. They do not happen at the same moment, and on a given morning one of them may not happen at all.
Say a contract is trading at 100,000. The strategy rests a buy at 99,995; the mirrored run rests a sell at 100,005. The price drifts down all morning and settles at 99,900. The buy is filled early and then watches the market keep going the wrong way. The sell is never touched—it sits above the market until it is cancelled. Across that whole morning the original held a losing position and the mirror held no position at all. Come the afternoon rally, the roles swap.
So the two runs are not a position and its negative. They are two different sets of trades, taken at different times, on the same recording. That is why the number of fills differs between them—by ten to fifty per cent in the strategies we tested—and it is why both directions can finish the day underwater. The mirror is not the opposite bet. It is a different bet, placed by the same rules from the other side of the spread, and it pays the same costs to be there.
Costs do not have a side
Profit per unit of notional traded splits into two terms: what your direction was worth, and what the trading cost you. Only the first one has a sign you can flip.
α is the edge—whatever the signal was worth on the positions it actually took. c is everything you pay for the privilege of taking them: the spread you cross or the queue you wait in, the venue’s fees, and the term that surprises people, the tendency for your orders to be filled at precisely the wrong moments.
Flip the orders and α changes sign. c does not. Whenever the cost of trading exceeds the edge available in either direction, both runs lose, and the mirror is not a new strategy. It is the same strategy paying the same bill from the other side of the book.
Half a spread each way
Start with the visible part. If you take liquidity you cross the spread, so relative to the midpoint you pay roughly half of it on the way in. If you make liquidity you are the other side of that same trade, so you earn roughly half of it instead. On paper, making looks like a business and taking looks like a tax.
On a liquid perpetual the half-spread is small. Top of book on a major contract is frequently one tick wide: a fraction of a basis point of the price on the largest names, and still under a basis point on a mid-cap. Half of that fraction is what a resting order collects for being there.
A maker fee of a basis point or so is already larger than the half-spread being earned. Before any question of signal quality or timing, a high-turnover maker strategy on a tight book starts underwater on fees alone. Turnover is what makes this decisive rather than annoying: a strategy that trades thousands of times its capital does not need a large per-trade cost to lose all of it.
The winner’s curse sits on both sides
The larger cost is not on the fee schedule. A resting order fills when somebody else decides to trade against it, and that decision is not random. Your bid gets hit hardest when sellers are in a hurry, which is disproportionately just before the price falls further. Your offer gets lifted when buyers are in a hurry, just before it rises. Getting filled is itself the bad news.
Glosten and Milgrom’s account of this remains the cleanest: a quoted spread has to exist because some of the traders hitting the quote know something the quoter does not, and the spread is the toll everyone else pays so that quoting stays possible at all. Earning the half-spread and paying adverse selection are one transaction seen from two ends. Whether the toll covers the loss is an empirical question, and at retail scale and retail speed it usually does not.
Here is the part that breaks the intuition. Mirroring the orders does not escape the selection—it moves you to the other side of it. The mirror of a bid that gets hit before a fall is an offer that gets lifted before a rise. Both are filled by someone who wanted that trade more than you did. Both can lose on the same afternoon, in the same market, and ordinarily do.
Explore this topic
What the sum and the difference tell you
That is what makes the flip worth running. Not as a search for a profitable mirror, but because two runs over the same recording give you two equations in two unknowns.
Average the two results and the edge cancels: what is left is what trading costs you, in basis points of everything you traded. Halve their difference and the cost cancels: what is left is what your direction was worth. One pair of replays, and the two quantities that are normally tangled together come apart.
We ran exactly this on six perpetual strategies across three weeks of recorded book data—momentum, mean reversion, book pressure, funding capture, all entering with resting orders. Five of them traded.
The two runs are near-mirrors rather than exact ones, for reasons the next section makes into a feature, so read the split as a good estimate rather than an identity.
- The cost term landed between roughly one and a half and two and a half basis points of traded notional for every one of the five, regardless of what the strategy was trying to do. That is the floor a resting order pays on that venue, and it barely moved from strategy to strategy.
- For four of the five, the edge term came in under a basis point—indistinguishable from nothing. Those strategies were not wrong about direction. They had no direction, and were paying the floor to discover it.
- The fifth had an edge term of nearly six basis points, pointing the wrong way. Flipped, it stopped losing. That is the genuinely backwards case, and the test could only see it because the cost floor had been subtracted out first.
- The sixth placed no orders at all, in either direction: its entry condition demanded a funding rate several times larger than anything that occurred in the period. A flip cannot rescue an order that was never sent, and a test suite should say so rather than report a tidy zero and move on.
The flip is a test of the engine
None of that decomposition means anything unless the flipped run is a real replay rather than an arithmetic trick. There is a one-minute diagnostic for this, and it is worth running before you trust any inverse result, including ours.
If your flipped backtest returns exactly minus the original—same fill count, same timestamps, profit negated to the last decimal—your engine is not simulating a market. It is negating a number. A mirrored limit order rests on the other side of the spread, where it is reached by different trades at different moments, so it has to fill a different number of times. In the six-strategy test above, fill counts differed between the two directions by ten to fifty per cent on every strategy that traded.
The rest of the checklist is about keeping everything else identical while the side changes.
- Only the order side flips. The decision tree, the gates, the sizing, the cancels and the reduce-only rules all have to run unchanged, or you are comparing two different strategies and learning nothing about either.
- Fees stay positive in both runs. A sign error that flips fees along with the side turns the mirror into free money, and it is easy to miss precisely because the output looks like the discovery you were hoping for.
- Funding, borrow and carry do flip. They attach to the position rather than to the order, so a mirrored perpetual pays what the original collected. If these do not change sign, they are not being modelled at all.
- Collateral and inventory limits bind identically. A mirror permitted to hold a position the original was refused is not a mirror.
- Fill counts, fill prices and fill times all differ. If any of the three is identical across the two runs, that part of the book is not being simulated.
Explore this topic
The rest of the battery
The flip belongs to a family of checks that say nothing about whether a strategy is good and everything about whether the measurement can be believed. None of them is intuitive. Most of them get skipped. Each one has caught something real.
- Shift the signal forward in time by an hour and re-run. A real edge degrades. Anything that survives untouched was reading the future somewhere in the data path.
- Replace the signal with a coin flip at the same trade frequency. The result should land near minus the cost floor, not near zero. Near zero means the engine is not charging you for trading.
- Run once with fees and once without. The gap tells you how much of the outcome is the fee schedule and how much is microstructure—two different problems with two different fixes.
- Add half a second of latency. If the result barely moves, fills are not contingent on the state of the book at the moment the order actually arrives.
- Double the order size. If profit doubles exactly, there is no depth model, and every conclusion you were about to draw about capacity is unsupported.
- Check the fill rate on resting orders. A post-only strategy that fills on nearly every quote is being filled at prices it should have missed.
- Replay the same window twice and compare the results byte for byte. A number that is not reproducible cannot be evidence of anything.
Explore this topic
Run them on ours
These checks are the unglamorous half of quantitative research. They do not produce a strategy; they decide whether you are entitled to believe the one you already have. Building the infrastructure to run them honestly—recorded books rather than candles, side-aware fills, real venue fee schedules, funding that accrues to the position—is a bigger job than most individual strategies are worth.
That infrastructure is what Quant Fun is for. The backtest replays the order book as it was recorded, charges the fees the venue actually charges, fills a resting order only when a trade reaches it, and runs the inverse of any strategy as an ordinary option rather than a special build. It is the same engine that executes live, so the thing you tested is the thing that trades.
Build the strategy. Then flip it, shift it, strip the fees out, and see whether what remains still looks like an edge. If it does, you have learned something. If it does not, you have learned it far more cheaply than the market was going to teach you.
Explore this topic

