Partial Fills in Automated Trading
A partial fill is an order that executed for less than its full quantity. Ten contracts submitted, four filled, six still working or cancelled. For a person watching a screen it is a minor annoyance. For automation it is a state divergence: the software believes it holds one position and actually holds another, and every subsequent decision — sizing, exits, risk limits — runs on the wrong number until something reconciles.
Partial fills are the most under-handled case in retail trading automation, because they are uncommon enough to miss in testing and consequential enough to matter when they happen.
Why they happen
Not enough size available at your price. An order for more contracts than are resting at the best level fills what is there and either works the remainder, cancels it, or fills progressively worse against deeper levels, depending on the order type.
They concentrate where liquidity is thin: far out-of-the-money strikes, distant expirations, overnight futures sessions, and short-dated options late in the day as spreads widen and market makers unwind hedges.
They also concentrate in fast markets, where resting size disappears as quotes update — which is when you are most likely to be submitting.
What breaks downstream
The fill itself is rarely the problem. The problem is everything that assumes it was complete.
Exit sizing. A system that submitted ten and exits ten while holding four is not closing a position — it is opening a short one for the difference. This is the most expensive version and it produces a position nobody intended.
Risk limits. Position count and exposure calculations run on a quantity that is wrong, so concurrency limits and capital ceilings are enforced against fiction.
Stops and brackets. A protective order sized to the submitted quantity covers more than you hold. When it triggers, the excess opens a position rather than closing one.
Averaging logic. A strategy that adds to positions computes the addition from a base that is wrong.
The common thread: the error compounds through every subsequent action rather than staying contained.
Multi-leg partial fills
The case that turns a defined-risk position into an undefined one.
A spread submitted as a package should fill as a package. Where legs are submitted separately — or where a broker's handling permits legs to fill independently — one leg can execute while the other does not.
The result is naked exposure. A trader who intended a defined-risk spread holds a single short leg with no protection, and the position's risk profile is nothing like what was intended.
This is the strongest argument for submitting multi-leg orders as a single package rather than decomposing them, and for using an order type that will not accept a partial execution where partial execution is unacceptable.
How to handle them
Read remaining quantity, not submitted quantity. The authoritative number is what the broker reports as filled and remaining per leg. A system keying off what it sent is keying off an intention.
Decide in advance whether to chase the remainder. Both answers are defensible and the decision must be made before it arises. Chasing means the position gets built at a worse average price; accepting means the position is smaller than planned. Deciding during is deciding badly.
Resize dependent orders. Stops, targets, and brackets should be sized to what actually filled. Where a broker maintains a linked bracket, confirm whether it adjusts automatically — behaviour varies and the failure mode is a protective order larger than the position.
Use immediate-or-cancel where a pending remainder is unhelpful. It converts an uncertain working state into a definite outcome, which removes an entire class of ambiguity.
Use fill-or-kill where partial is unacceptable. On a leg that would leave you unhedged, no fill is better than half a fill. Expect it to fill less often.
Reconciliation is the actual answer
Every mitigation above reduces the frequency of divergence. Reconciliation is what catches it when it happens anyway.
Query the broker for actual positions on a schedule and on every restart, and treat the broker as authoritative over internal state. Not as a debugging tool — as a routine operation.
The cases that make it necessary are not only partial fills. Assignment appears in an account without the system initiating it. Broker auto-liquidation closes positions the software believes it holds. An ambiguous submission that timed out may or may not have landed. All of these produce the same symptom, and all are caught by the same habit.
On any ambiguous outcome, query rather than resubmit. Resubmitting an order that may already exist is how a partial fill becomes a doubled position.
What this means for automation
Three design points.
Treat quantity as a value read from the broker, not a value your system owns. That single reframing eliminates most of this category.
Test the case deliberately. Partial fills are rare enough that they will not appear in a short test run. Simulate one and confirm the system does something sensible, because discovering the handling live is expensive.
Keep reconciliation off the order path. It is periodic, potentially slow work that must not delay a live submission — the worker thread pattern. On a self-hosted deployment the schedule and the alerting are yours to configure, which means they happen only if you configure them.
The honest limits
Partial fills cannot be prevented. They are a consequence of finite liquidity, and any order large enough relative to the book will encounter them.
Order types that avoid them trade one problem for another: fill-or-kill avoids partials by frequently not filling at all, which on an exit is worse.
And handling them correctly does not improve a strategy. It prevents a category of avoidable loss that has nothing to do with whether the strategy works. Position sizing bounds what the remaining errors cost — capital divided by twenty as the ceiling on any single position, under the divide-by-20 rule.
Frequently asked questions
What is a partial fill? An order that executed for less than its full quantity, leaving a remainder working or cancelled.
Why do partial fills happen? Insufficient size available at your price, most commonly in thin strikes, distant expirations, overnight sessions, and fast markets.
What breaks when automation ignores them? Exit sizing, risk limits, and protective orders all run on the wrong quantity, and an oversized exit can open a position rather than close one.
Should I chase the unfilled remainder? Either answer works, and it must be decided in advance. Chasing worsens the average price; accepting leaves a smaller position.
How do I prevent them on spreads? Submit multi-leg orders as a package rather than as separate legs, and use fill-or-kill where a partial execution would leave unhedged exposure.
Disclaimer: This article is educational content about trading mechanics and software. It is not investment advice, financial advice, tax advice, legal advice, or a recommendation to buy or sell any security, nor a recommendation of any strategy, order type, or position size. Any instruments, figures, or examples are used solely to illustrate mechanics. Options and futures trading involve substantial risk of loss and are not suitable for all investors. Please read Characteristics and Risks of Standardized Options before trading options. Automated trading carries additional risks including software defects, connectivity failures, broker API changes, and outages that may prevent orders from being placed, modified, or cancelled. Stop orders do not guarantee an execution price and stop-limit orders may not execute at all. Past performance does not indicate future results, and no configuration, order type, position-sizing rule, or risk setting can guarantee a profit or prevent a loss.
StaxInvesting LLC sells self-hosted trading software. It is not a broker-dealer, investment adviser, or financial institution, and it does not manage accounts, hold member funds, place trades on behalf of members, or access member brokerage accounts. Members run the software in their own cloud environment, connect their own brokerage accounts under their own credentials, and are solely responsible for their configuration, their credential security, and every trade executed in their account. Broker order handling and available order types vary; verify against your broker's current documentation. Consult a qualified financial adviser and tax professional regarding your individual circumstances.