Methodology

Liquidity Constraints in Backtesting: Why a Paper Strategy Cannot Always Be Filled

Liquidity constraints decide whether a backtested trade could actually have happened. A guide to volume caps, capacity, thin stocks and the filters that keep a test honest.

A backtest can buy anything. Real money cannot. Liquidity constraints are the rules you add to a simulation so that it can only trade what could plausibly have been traded, at a size that would not have moved the price beyond your assumptions. Skip them and a strategy can quietly assume it bought more shares in a day than actually changed hands, which is not a difficult trade, it is an impossible one.

This is the realism layer that separates an interesting pattern from an investable process. It also happens to be the layer that most often kills a beautiful result, which is precisely why it should be applied early rather than last.

The three things liquidity limits

Liquidity does not just affect the price you get. It affects whether the trade exists at all, and it affects how large the whole strategy can ever be.

Whether the fill is possible. If a stock traded a modest value on a given day and your simulated order is a large multiple of that, no execution assumption saves you. The order simply could not have been filled that day at anything close to the modelled price.

How long the trade takes. A position that is too large for one day has to be built across several. During those days the price moves, and the average price you achieve is not the price on the signal day. A backtest that fills instantly is claiming an advantage the strategy never had.

How much money the strategy can hold. This is capacity. A rule may be perfectly sound at one portfolio size and unworkable at ten times that size, because at ten times the size half the universe becomes untradeable. Capacity is a property of the strategy plus the money, never of the strategy alone.

Building the constraint into the test

The mechanics are straightforward and mostly consist of refusing to do things.

  1. Define a tradeable universe up front. Before any signal is computed, filter the universe to names that met a liquidity standard as of that date. Common standards are a minimum average traded value over a trailing window, a minimum number of trading days with activity, and exclusion of stocks in trading restrictions such as circuit bands. The filter must be applied using data available on that date, not on today’s liquidity, or you have reintroduced lookahead bias.
  2. Cap participation. Limit the strategy to a fixed share of the stock’s traded volume or traded value on each day. Any order larger than the cap gets partially filled and the remainder carries forward, or is cancelled, depending on the rule you choose. State which.
  3. Model partial fills honestly. If the strategy could only get half the position, it holds half the position, and its return reflects half the position. Silently topping up the fill at the modelled price is the single most common way liquidity constraints get defeated in practice.
  4. Respect halts and bands. Days when a stock hit a price band or did not trade are days when your order did not execute. Treating them as normal trading days manufactures fills at exactly the moments they were unavailable.
  5. Re-run at multiple capital levels. Test the strategy at a small, medium and large notional. Plot how the net result decays as size grows. That decay curve is the capacity statement, and it is far more useful than a single headline number.

The output of this work is not just a lower return. It is a description of the conditions under which the strategy is real.

The small company trap

Backtests on smaller companies tend to look better than backtests on large ones, and the reasons are a mix of the genuine and the artificial. Untangling them is one of the more valuable things a careful tester does.

The genuine part is that smaller companies have different risk and return characteristics, which is the subject of the size factor.

The artificial part has several sources. Thin trading means recorded prices can move a long way on very little volume, so historical price series show moves that no meaningful quantity could have transacted at. Wide spreads mean the modelled midpoint was never available. And because thin names delist, get suspended or fade more often, they are where survivorship bias does the most damage.

The honest treatment is not to exclude smaller companies. It is to apply the same participation caps, spread aware slippage and delisting handling that you would apply anywhere, and then see what is left. If the result survives, it is interesting. If it evaporates, you have learned something important cheaply.

Liquidity is not constant

A stock that trades comfortably today may have been thin five years ago. A stock that is liquid in a calm market may be untradeable in a panic. Both facts break the common shortcut of applying a single liquidity filter based on recent data across a long history.

Two disciplines follow.

Use the liquidity that existed then. Your universe filter for a date in the past should use trailing volume as of that date. Using current liquidity to decide what was tradeable historically selects for companies that went on to become liquid, which is a fact from the future.

Assume liquidity thins in stress. Volume can spike in a crisis while depth collapses, so headline turnover can look healthy at exactly the moment execution is worst. If a strategy’s results depend on trading during turbulent periods, its liquidity assumptions during those periods deserve their own scrutiny, alongside slippage and a proper stress test.

Where liquidity meets the rest of the design

Liquidity constraints interact with almost every other design choice, and the interactions are usually unwelcome.

  • Rebalancing frequency. Trading more often means more orders competing against the same daily volume. A monthly rule and a daily rule with the same signal can have very different fill profiles. See rebalancing frequency and backtest results.
  • Position count. More positions means smaller orders, which is easier to fill, but also more fixed charges and more names in the thin tail of the universe.
  • Concentration. A high conviction portfolio needs large positions in few names, which is precisely where participation caps bite hardest.
  • Signal speed. Fast signals demand urgent execution, and urgency is expensive. Slow signals can be worked patiently, which makes their liquidity assumptions gentler and more believable.

None of these has a right answer. The point is that a liquidity constraint is not a switch you flip at the end. It shapes what the strategy can sensibly be.

What liquidity modelling does not tell you

  • It does not guarantee your fill. A participation cap is a plausibility rule, not a promise. Historical volume tells you what traded, not what would have traded if you had also been in the market.
  • It does not capture who was on the other side. Volume driven by a single large block, an index rebalance or a delivery heavy day is not the same as continuously available liquidity, even when the daily total looks identical.
  • It does not account for your own footprint over time. If a strategy repeatedly trades the same names on the same days, its presence changes the market it is trading in. No historical simulation can observe that.
  • It cannot fix a signal problem. Constraining size makes a result honest about execution. It says nothing about whether the underlying edge was real or overfitted.
  • It ages. Liquidity conditions, market structure and participation change over time, so a capacity estimate from a decade of history is a rough guide to today at best.

The right question is never “did this strategy work”. It is “at what size, in what universe, at what participation, did this strategy work, and what happened when any of those changed”.

Getting liquidity right rarely makes a backtest look better. It makes it defensible, and it tells you in advance the one thing a headline return never will: how much money the idea can actually carry.

This article is educational. Altys Labs is not a registered research analyst or investment adviser, and nothing here is investment advice or a recommendation to buy, sell, or hold any security.

Frequently asked questions

What are liquidity constraints in a backtest?

They are rules that limit how much a simulated strategy is allowed to trade in a stock on a given day, usually as a share of that stock's actual traded volume. Without them a backtest can assume it bought more shares than ever changed hands, which is not a trade anyone could have made.

How much of a stock's daily volume can a strategy realistically trade?

There is no fixed answer, but desks typically cap participation at a small share of average daily traded value and spread larger orders across multiple days. The right cap depends on urgency, on how concentrated the stock's volume is, and on how much price impact the strategy can tolerate.

Why do backtests on small companies look so good?

Partly because smaller companies genuinely behave differently, and partly because thin trading makes their historical prices easy to move and hard to transact at. Results in illiquid names are unusually sensitive to execution assumptions, so they need volume caps and conservative slippage before they mean anything.