Lot sizing decision guide · 13

Measure the filled position and the unfilled live order separately

Submitting 1.00 lot does not create a 1.00-lot position when only 0.55 lot has filled. If the other 0.45 lot remains live, add its conditional loss reserve to the stop loss on the filled 0.55 lot before comparing the order with the budget.

Three points to establish first

  • Rebuild cumulative quantity and VWAP from each unique execution ID.
  • Store remaining quantity together with its live, cancel-pending or canceled state.
  • Combine filled loss and conditional live-remainder loss; reduce or cancel the remainder if the budget is exceeded.

Durable reference map

A three-stage method to reuse whenever conditions change

Keep the sequence of inputs, calculation and exception testing stable instead of relying on a market forecast.

  1. Align inputs and unitsGo to equations and definitionsCumulative filled quantity・Fill VWAP・Price-distance reserve for filled and live-remainder exposure
  2. Reconcile the worked exampleGo to table and calculation stepsA 1.00-lot order with 0.55 lot filled in two executions
  3. Test exceptions and next checksGo to rules and counterexampleDerive current quantity from unique executions, not submitted quantity.

Submitted quantity is not the current position

A 1.00-lot order can execute in several pieces because of available liquidity and order instructions. Current position size comes from the sum of unique executions, not from the amount accepted for submission.

Filled and average-price status fields are useful for cumulative reconciliation, but they serve a different role from records that identify each partial execution. Use persistent execution IDs to reconcile fill details with the cumulative fields.

  • Retain the parent order ID and every execution ID
  • Do not add a duplicate event twice
  • Record cancel request and cancel confirmation at separate times

Derive filled stop loss from VWAP

In the example, buying 0.30 lot at 1.1000 and 0.25 lot at 1.1010 produces a 1.10045455 VWAP. Loss to a 1.0950 stop is USD 300 whether each fill is calculated separately or the 0.55-lot total is calculated from VWAP.

Keep full price precision through the intermediate calculation and round only the final currency amount. State position direction because the adverse-price sign reverses for a short.

  • Cumulative filled size is 0.30 + 0.25 = 0.55 lot
  • VWAP is quantity weighted, not the simple mean of two prices
  • Express the stop price and contract values in compatible price units

Reserve future loss for a live remainder

A live 0.45-lot remainder is not part of the current position, but it is not zero risk. If it fills at a hypothetical 1.1020 and shares the 1.0950 stop, it adds USD 315 to the USD 300 already filled, for a USD 615 price-distance reserve.

The price-distance reserve alone exceeds the USD 600 budget by USD 15, so this scenario requires reducing the remainder or obtaining cancellation confirmation. Fees, account-currency conversion differences and further adverse execution are not in USD 615 and must be added separately. For an unknown future fill, use a conditional price consistent with the limit, maximum tolerated price and protective-order linkage.

  • Reserve the remainder while it is live
  • Keep the reserve during cancel-pending status
  • Set remainder risk to zero only after cancellation is confirmed

IOC and resting orders give the remaining quantity different meanings

When IOC cancels the unfilled balance, the 0.45 lot is not reserved as a live order. Under a RETURN or GTC instruction, the residual order may continue working after the partial fill.

Keep order policy, venue acknowledgment and cancellation confirmation as a state transition instead of compressing them into one Boolean flag.

Do not confuse a partial entry with a scale-out

This article covers an intended entry that has not finished filling and may still have a live remainder. Article 14 covers a deliberate partial exit from an existing position and recalculates realized P&L plus the residual holding.

  • Use this article for an incomplete entry order
  • Use Article 14 after an intentional partial exit
  • Use Article 15 for fees and adverse execution after moving a stop to entry

Calculation framework

Cumulative filled quantity

Read the role of each equation first, then follow the numerical example to check the decision path.

01

Cumulative filled quantity

EquationQ_filled = Σ q_i
q_i: quantity of each deduplicated execution in lots

In plain language: Reconstruct the currently held quantity from execution records.

When this conclusion does not apply: Sum only non-negative q_i values on one quantity basis, excluding canceled unfilled quantity and duplicate events.

02

Fill VWAP

EquationP_VWAP = Σ(q_i × P_i) / Q_filled
P_i: price of each execution
Q_filled: cumulative filled quantity

In plain language: Combine fills of different sizes into one quantity-weighted entry price.

When this conclusion does not apply: VWAP is undefined when Q_filled is zero.

03

Price-distance reserve for filled and live-remainder exposure

EquationR_price = L_filled,price + L_live_remainder,price
L_filled,price: price-distance loss from the filled position to its stop
L_live_remainder,price: added price-distance loss if the live remainder fills at the stated assumption and reaches that stop

In plain language: Reserve the price-distance loss on filled and possible additional exposure in one currency; add fees, conversion differences and further adverse execution separately.

When this conclusion does not apply: Define L_filled,price and L_live_remainder,price as non-negative amounts in one account currency. A confirmed canceled remainder is zero; a cancel-pending remainder is not. Do not call this expression total loss until fees, conversion and further adverse execution have been added.

A checkable example

A 1.00-lot order with 0.55 lot filled in two executions

All prices, quantities, the 100,000-unit contract, 1.0950 stop and USD 600 budget are hypothetical educational inputs. The calculation covers price distance only and excludes fees, conversion differences and further adverse execution. It is not observed liquidity or fills.
Execution IDFill quantitylotFill priceUSD/base unitCumulative filledlotRemaining orderlot
F10.31.10.30.7
F20.251.1010.550.45

Calculation steps

  1. Cumulative filled quantity is 0.30 + 0.25 = 0.55 lot; unfilled quantity is 1.00 − 0.55 = 0.45 lot.

  2. VWAP is (0.30 × 1.1000 + 0.25 × 1.1010) ÷ 0.55 = 1.10045455.

  3. Filled stop loss is (1.10045455 − 1.0950) × 100,000 × 0.55 = USD 300.

  4. If the live remainder fills at 1.1020, its added reserve is (1.1020 − 1.0950) × 100,000 × 0.45 = USD 315.

  5. The total price-distance reserve is 300 + 315 = USD 615, exceeding the USD 600 budget by USD 15 before fees or other additions.

Result: The current position is 0.55 lot, but a live 0.45-lot remainder creates a USD 615 price-distance reserve. It already exceeds the budget before separately added fees or other execution effects, so the remainder should not stay unchanged.

When this conclusion does not apply: If an IOC acknowledgment confirms cancellation of the other 0.45 lot, exclude its USD 315 reserve and retain only the USD 300 stop risk on the filled 0.55 lot.

Distinguish submitted quantity from confirmed position

Submitting 1.00 lot expresses an order intention; it does not create a 1.00-lot position. Execution can arrive in pieces, and the remaining balance can stay live, cancel, reject, or expire according to order instructions. Current position quantity must be reconstructed from unique confirmed fills rather than the amount accepted for submission.

In the hypothetical order, fills of 0.30 and 0.25 lot create a confirmed 0.55-lot position. The other 0.45 lot remains an order-state question. Recording the full submitted amount as held would overstate current exposure, while setting the remainder to zero without cancellation confirmation would understate conditional exposure.

Status fields such as cumulative filled, remaining, and average fill price are useful reconciliation summaries. Individual execution records have a different role: they identify each partial fill and its price. The two views should balance, and duplicate callbacks must not cause the same execution to be counted twice.

Compute VWAP from quantities, not a simple price average

Fill prices must be weighted by their executed quantities. The example’s 0.30 lot at 1.1000 and 0.25 lot at 1.1010 produce a VWAP of 1.10045455, not the simple average 1.1005. The difference may look small, but it propagates into stop loss and reconciliation. Unequal fill sizes make the weighting economically necessary.

VWAP is undefined when confirmed filled quantity is zero. A platform may display a provisional average before the first fill; that value must not enter position risk. Full price precision should be retained through the monetary calculation, with currency rounding applied only at the reporting boundary.

The direction and contract basis are necessary. For a long, entry above a 1.0950 stop creates adverse distance; for a short the sign reverses. The 100,000-unit teaching contract and prices are hypothetical, so a real symbol’s multiplier, pip convention, and account conversion must be retrieved independently.

Reconcile filled stop loss by two independent paths

Using VWAP, the price difference from 1.10045455 to 1.0950 multiplied by 100,000 and 0.55 lot gives USD 300. The same amount should result from calculating each fill’s stop loss and summing them. Agreement provides a useful invariant for fill aggregation and detects premature price rounding.

A mismatch can reveal rounded VWAP, a missing fill, duplicate event, wrong contract size, or inconsistent price basis. The system should stop further sizing until cumulative quantity, VWAP, and fill-level currency loss reconcile. A convenient status field should not override detailed records merely because it arrives last.

The USD 300 amount covers price distance on the filled position only. Fees, conversion differences, and further adverse execution are excluded in the example and need separate additions. Calling USD 300 total risk would overstate the scope of the formula and hide the still-live order remainder.

Reserve conditional loss for a live unfilled balance

A live 0.45-lot remainder is not part of the current position, but it can become exposure without a new sizing decision. The ledger therefore needs a conditional reserve based on a defensible possible fill price and the linked protective stop. Treating it as zero until execution can let the parent order exceed its original budget.

At the hypothetical 1.1020 future fill and 1.0950 stop, 0.45 lot adds USD 315 of price-distance reserve. Combined with the filled USD 300, the parent order carries USD 615, exceeding the USD 600 budget by USD 15 before fees, conversion differences, or additional adverse execution.

The possible fill price must respect order type, limit, maximum tolerated price, and protection linkage. It is a scenario, not a prediction. If the remainder’s fill price is unknown and no conservative rule exists, the correct output is unavailable or cancellation, not a zero reserve that assumes nonexecution.

Model order instructions as state transitions

An IOC instruction can fill available quantity and cancel the balance, while a RETURN or GTC-style policy can leave the remainder working. The exact provider definitions govern. The state model should move quantity among submitted, filled, live remainder, cancel pending, canceled, rejected, and expired states based on acknowledged events.

A cancel request does not release reserve until cancellation is confirmed or another authoritative state proves the balance inactive. The order can fill while cancellation is pending. If replacement instructions are sent early, both potential paths may need temporary capacity so the system does not reserve only the preferred outcome.

Event IDs and sequence information prevent replay errors. Out-of-order callbacks can report an older remaining amount after a new fill. The ledger should reconcile cumulative quantities rather than let the most recently received message overwrite economically newer state without validation.

A state snapshot should therefore be derived from the full acknowledged event set and carry a monotonic version. Consumers can reject an older snapshot even if it arrives later. This approach separates transport order from economic order and keeps the 0.45-lot remainder from reappearing after a confirmed cancellation.

Separate price-distance reserve from an all-in loss estimate

The formula USD 300 plus USD 315 is explicitly a price-distance reserve. It excludes fees, account-currency conversion changes, and trigger-to-fill overrun. Those components should be added in their own units and fields before the result is called total estimated loss.

Known fixed costs can reduce the parent budget, while quantity-proportional costs attach to filled and possible remainder quantities. A cost already embedded in execution prices should not be deducted again. If future fees depend on uncertain filled quantity, the scenario should compute them consistently with the conditional remainder.

A single USD 600 budget should govern the parent order lifecycle. Splitting the entry into executions does not create a fresh budget for each fill. Conversely, a canceled remainder should release only its conditional reserve; it should not erase stop risk on the confirmed 0.55-lot position.

If the aggregate reserve crosses budget, the response should target the still-controllable state. A live remainder can be reduced or canceled, while the confirmed position requires its own protective management. Rewriting earlier fills or assigning a new budget to each child would conceal rather than resolve the parent-level breach.

Do not confuse a partial entry with a scale-out

A partial entry means the intended position has not finished filling and an unfilled balance may remain live. A scale-out means an established position has been deliberately reduced by confirmed exit executions. Both can show a smaller current quantity, but their future states and P&L accounting differ.

The 0.45 lot here is a possible future addition, not a residual holding. It needs a reservation until canceled. In a scale-out, the residual 0.60 lot is already held and needs open-stop risk, while the exited quantity contributes realized P&L. Interchanging the labels can double count or omit exposure.

Order side alone may not resolve the distinction in netting accounts, where opposite-side fills reduce a position rather than open a separate one. The event record should link executions to the parent intent and provider position action. Derived state must follow confirmed fills, not the user’s informal description.

Handle stop linkage when fills arrive in pieces

Protective orders may be placed for the submitted amount, updated after each fill, or created only after execution depending on the workflow. The current protected quantity should reconcile with confirmed position size, while the live remainder needs a documented protection plan if it fills. A stale stop quantity can create accidental over- or under-closure.

A parent-child link should survive replacements and amendments. If each partial fill creates a separate protective order, their combined quantity and stop prices must reconcile with the position. If one aggregate stop is used, updates should be acknowledged before the ledger assumes the new coverage is active.

A fill that arrives without expected protection is not repaired by the original sizing formula. It is an operational exception that can increase conditional loss and should block further quantity until resolved. The record should preserve the gap between intended and confirmed protection rather than infer success from a submitted instruction.

Test duplicate, out-of-order, and cancel-pending events

A duplicate execution-ID test should leave cumulative filled quantity at 0.55 rather than 0.80. An out-of-order test delivers F2 before F1 and expects the final VWAP and quantity to match the unique set regardless of arrival order. These cases expose systems that sum callbacks instead of reconciling executions.

A cancel-pending test sends a cancellation request for the 0.45 remainder and then a fill before confirmation. The reserve must remain until the fill changes it into position risk. Releasing at request time would temporarily create fictitious capacity and could permit another order that exceeds the parent budget.

Boundary tests include zero filled quantity, negative fill quantity, remaining below zero, cumulative above submitted amount, missing side, and prices on inconsistent units. The safe state is unresolved with no new size. Absolute values or clipping should not make contradictory lifecycle data appear valid.

Reprice the remainder when its conditions change

A live remainder’s conditional fill price can change after a limit amendment, market movement, or execution-policy update. Recompute its reserve using the active order state and current linked stop, preserving each version. Do not reuse the first USD 315 estimate after the permissible fill range changes.

The filled position can also change if the stop is amended or the account-currency factor moves. Its open risk should be recomputed from confirmed quantity and a conservative executable assumption. A favorable current mark is not negative loss reserve unless the policy explicitly permits and caps such offsets.

When the remainder is confirmed canceled, its conditional component becomes zero, leaving the USD 300 price-distance loss on the filled position before additions. That counterexample demonstrates why cancellation status matters. It does not turn the remaining position’s stop trigger into a guaranteed fill.

Build the parent-order ledger around immutable identities

The parent row should retain submitted quantity, order instruction, prices, stop linkage, budget, specification and conversion versions, and current lifecycle state. Child execution rows need unique IDs, quantities, prices, timestamps, cumulative fields, fees, and provider references. Derived VWAP and reserves should be reproducible from them.

Every state transition should identify the event that caused it. A status update without an execution may change remaining or cancellation state but should not create filled quantity. An execution creates position exposure even if the status callback is delayed. The reconciliation logic needs explicit precedence and consistency checks.

Corrections append events rather than overwrite fills. If a provider busts or amends an execution, the ledger should reverse or replace it through the official identity and recalculate dependent values. Historical snapshots preserve what capacity was believed available at each decision time.

A reconciliation checksum can compare submitted quantity with confirmed fills plus confirmed inactive remainder and current live remainder. The equality is not a risk estimate, but it reveals missing state before VWAP and conditional loss are trusted. Every term must use the same lot basis and parent identity.

Reconcile the complete parent after execution ends

When the remainder fills, cancels, or expires, the final submitted, filled, and inactive quantities should balance. Actual fees, fill prices, and conversion can replace conditional values in the outcome ledger while the original reserve remains intact for forecast evaluation. This prevents hindsight from making every parent appear perfectly budgeted.

If total realized or open estimated loss exceeds USD 600, decompose the variance into conditional fill price, adverse stop execution, charges, conversion, and quantity-state error. The initial USD 615 example already breaches price distance, so its corrective action should precede reliance on later favorable fills.

A parent that finishes at 0.55 lot after confirmed IOC cancellation should not be analyzed as a failed 1.00-lot fill without context. Execution quality and risk control ask different questions. The ledger can report fill rate while correctly limiting current position risk to confirmed quantity.

Use API documentation as lifecycle evidence

SEC examples support that one order can receive partial executions at several prices before its balance is canceled. Interactive Brokers documentation distinguishes cumulative status fields from individual execution details and unique execution identifiers. MetaQuotes documentation supports different remainder behavior under IOC and RETURN-style policies.

Those sources do not provide the 1.1000, 1.1010, 1.1020, or 1.0950 prices, the USD 600 budget, or observed liquidity. All values are hypothetical. Provider implementations can differ, so production state transitions must follow the current official API and account model.

The evidence-backed conclusion is that submitted, filled, and live-remainder quantities are distinct. The reserve method is an article-level control built from that distinction. It estimates price-distance exposure under stated conditions and does not guarantee fill, cancellation, or realized loss.

State the parent-order decision with both current and conditional exposure

After the two fills, current position is 0.55 lot at a 1.10045455 VWAP and carries USD 300 of hypothetical price-distance loss to 1.0950. If 0.45 lot remains live and could fill at 1.1020, it adds USD 315. The combined USD 615 exceeds the USD 600 parent budget before other additions.

The decision consequence is to reduce or cancel the live remainder and recalculate after confirmation, not to pretend the full 1.00 lot is already held or the unfilled amount has no effect. If IOC cancellation is confirmed, the USD 315 component is released while the filled-position risk remains.

This reconstruction is educational and does not recommend an order or predict execution. It shows how unique fills, VWAP, order state, and conditional reserves prevent two opposite errors: overstating the current position and understating the exposure that a live remainder can still create.

A final audit should reproduce 0.55 lot and VWAP from F1 and F2, compute USD 300 filled price-distance loss, then add the live-remainder scenario only when its state is active. The same audit should fall back to USD 300 after confirmed IOC cancellation without calling that amount total realized loss.

Decision and control rules

  1. Derive current quantity from unique executions, not submitted quantity.
  2. Do not produce another size when VWAP, filled quantity or remaining quantity fail to reconcile with execution details.
  3. Reserve a possible live remainder until cancellation is confirmed.
  4. Combine filled and conditional live-remainder price-distance loss in one currency, then add fees, conversion differences and further adverse execution separately.
  5. If the total exceeds budget, reduce or cancel the remainder and recalculate after confirmation.

Common failure modes

  • Recording a 1.00-lot position as soon as 1.00 lot is submitted
  • Using the simple mean of two fill prices for a 0.55-lot VWAP
  • Setting remaining to zero when a cancel request is merely sent
  • Adding duplicate order-status events twice
  • Treating a residual position after a scale-out as an unfilled entry

Evidence and specifications

  1. SEC — Frequently Asked Questions: Rule 605 of Regulation NMS

    What this source supports: The SEC Rule 605 FAQ gives an example of one order receiving partial executions at multiple prices before the balance is canceled, supporting aggregation from execution quantities and prices rather than the submitted quantity alone.

  2. IBKR Campus — Placing Orders using TWS Python API

    What this source supports: Current IBKR Campus training shows orderStatus receiving filled, remaining, avgFillPrice and lastFillPrice while execDetails receives individual executions.

  3. Interactive Brokers Documentation — Execution Reference

    What this source supports: IBKR’s current Execution reference states that every partial fill has a separate ExecId and defines fill quantity, price, cumulative quantity and average price fields.

  4. MQL5 Reference — Symbol Properties

    What this source supports: MetaQuotes defines IOC as filling available volume and canceling the remainder, while RETURN continues processing the residual quantity, supporting an explicit live-versus-canceled remainder state.

Questions to resolve

Is average fill price alone enough to retain?

No. Keep execution IDs, each quantity, price and time for audit and deduplication, then reconcile them with the broker’s cumulative fields.

Will a displayed remainder always fill later?

No. IOC can cancel it, while RETURN or GTC can leave it working. Read both the order instruction and confirmed state.

How can I reserve risk when the remainder’s fill price is unknown?

Use an explicit conditional price consistent with the limit or maximum tolerated price. Do not freeze the current quote for an order without price protection.

Should the stop update after every partial fill?

Verify that protective orders actually cover filled quantity. Linkage differs by broker and venue, so record any interval during which the fill is unprotected.

Recalculate from current inputs

Enter filled quantity, VWAP and live remainder separately, then add fees and other execution effects before reconciling the reserve with the budget.

Important: This educational example explains recalculation during partial fills. Actual order state, cancellation timing, fill prices and protective-order behavior vary by broker and venue, and no loss ceiling is guaranteed.