The price touched your limit. Why is your order still waiting?
Understand limit-order eligibility, queue priority, partial fills and cancellation races. Build more honest fill assumptions for trading-robot research.

The candle says yes; the account says nothing
You pause a chart at the exact moment you expected the robot to enter. The candle’s low is below the intended buy limit. The strategy report contains a profitable trade from that price, but the demo account contains no execution. It is tempting to blame the broker, the robot or the chart. Before choosing one, establish what each record actually proves.
A price observation proves that a particular feed reported a particular value at a particular time. It does not necessarily prove that your order was active, that the relevant quote side reached its limit, that sufficient quantity was available to it, or that an execution report was received. Those are separate facts along a chain of events.
Price eligibility and confirmed execution are different states of evidence. A useful research model keeps that distinction visible. Otherwise every favorable price touch can become an assumed trade, while real-world non-executions are treated as inconvenient exceptions rather than part of the strategy’s economics.
This article uses hypothetical prices, quantities and timelines to examine that chain. The queue example describes a simplified centralized price-time book, not a claim about how every retail Forex provider operates. The aim is educational: identify the information needed to evaluate fill assumptions and design a controlled observation study. The discussion remains a documentary analysis, with no executable order instructions or claim that a detailed simulator predicts actual execution.
First identify the market mechanism you are modeling
A centralized order book matches orders under venue-specific allocation rules. Some products use price-time priority at a price level; others use different allocation methods. CME’s documentation explicitly describes several supported algorithms, including FIFO and pro-rata variants. Supported Matching Algorithms. A generic drawing of a queue therefore cannot stand in for the actual product’s rules.
Retail spot Forex and CFDs need another distinction. The quote and execution service presented by a provider is not automatically a transparent view of one consolidated exchange queue. A client’s pending order may be handled according to the provider’s contractual and technical execution model. A public exchange’s FIFO example can teach an allocation concept without proving the priority of that client’s order.
Write the execution setting at the top of the research note. Identify the instrument, provider or venue, account type, data feed and order semantics. If those are unknown, label the simulator’s assumptions as a model rather than importing a queue explanation as fact. The gap between model and target environment is itself part of the research result.
The distinction prevents a common false inference: seeing volume on a market-data feed and treating it as the quantity available to a particular retail account. Reported trade volume, displayed depth, provider liquidity and an order’s executable allocation can refer to different populations. Their units may also differ between contracts, base-currency units and lots.
For the next few sections, separate two teaching views. The quote-side view explains why the observed chart price may not make an order eligible. The simplified FIFO view explains why eligible resting orders can compete for quantity. Combining them into one universal Forex execution story would create more confidence than the evidence supports.
A buy limit cares about a different side from a bid chart
Suppose a hypothetical buy limit is 1.10000. At one observation the bid is 1.09990 and the ask is 1.10010. The midpoint is exactly 1.10000. A midpoint chart touches the limit, and a bid chart falls below it, while the ask remains above the maximum purchase price. Under an execution model requiring an eligible ask for that purchase, this observation does not establish a fill.
The reverse issue appears for a sell limit. A chart built from asks can reach a desired sale price while the bid available for selling remains below it. The bid-and-ask article explains the basic two-sided quote. For a fill audit, the important step is retaining the side and timestamp rather than treating an unlabeled candle as a universal executable price.
Provider APIs can also distinguish an order’s trigger condition from the price used for its execution. OANDA’s order definitions document such platform-specific conditions. Order Definitions. That is a reason to read the exact specification, not permission to assume every provider or order type follows the same rule.
An observed midpoint is not a transaction confirmation. Even an eligible quote side is only one part of the evidence. The order must exist under the applicable conditions, and an actual fill must be reflected in the provider’s records. A research model that uses bid-only bars for both buying and selling should declare what it assumes about the missing side.
For the hypothetical quote, the spread is 0.00020 and the midpoint is 0.00010 away from either side. An apparently tiny difference can decide whether a narrow limit entry occurs at all. The consequence is not merely a small cost adjustment to a guaranteed trade; it may change which trades enter the sample.
Another distinction is whether the hypothetical limit is already marketable. With an ask of 1.10010 and a purchase limit of 1.10020, the displayed ask is within the allowed price in this simplified quote example. The instruction need not wait for a later decline merely because its type contains the word limit. Its actual outcome still depends on acceptance, available quantity and the provider’s rules. The label describes a price constraint; it does not by itself establish passive liquidity provision.
That matters when comparing research records. Two strategies can both use limits while one generally rests away from the quote and another often arrives at a marketable price. Their waiting times, completion patterns and exposure to queue uncertainty can differ. Classify the instruction relative to the relevant quote at its eligible arrival, when that evidence exists, rather than inferring the economic behavior from the order-type name alone.
The order must be eligible when the market event occurs
A backtest can accidentally use a candle’s earlier low to fill an order created from that same candle’s close. The price event may be real, but it occurred before the decision existed. Calling the resulting entry a limit fill does not repair the time ordering. The order needs an eligible lifetime that begins after its actual activation under the model.
Consider a hypothetical sequence measured relative to one second boundary. The signal is formed at zero milliseconds, the request is sent at twenty, the server accepts it at forty, the relevant quote appears at fifty and the acknowledgment reaches the client at eighty. The quote occurs after server acceptance even though the client has not yet received the acknowledgment.
Now change server acceptance to sixty milliseconds while leaving the quote at fifty. The same quote occurred before the order became active in this simplified model. A local chart showing the touch cannot distinguish the two cases. You need meaningful server-side event records or an explicitly conservative timing assumption, not just the time the client printed a message.
Keep event time and receipt time separate. A late message can describe an earlier event; a fast local log can precede remote acceptance. Unsynchronized clocks add uncertainty, so a millisecond comparison is only meaningful when the time bases and their accuracy are understood. Extra timestamp digits do not create synchronization.
The article on the order lifecycle covers the broader progression from request to terminal state. Here the narrower question is whether the specific market observation used to justify a fill fell inside the order’s eligible interval. Reconstruct that interval before investigating priority or blaming a missing trade on insufficient liquidity.
A small FIFO queue makes the quantity problem visible
Imagine a simplified centralized book where all resting orders at one price receive strict time priority. Two hundred units are ahead of your order. Your order requests one hundred units. Another two hundred units arrive behind you. Assume no hidden quantity, no cancellations, no priority changes and no other allocation rules during the example.
An incoming opposite-side order executes 180 units at that price. Those units are allocated to the quantity ahead of you. Twenty units remain ahead, and your order has received nothing. The price traded at your level, but that event alone did not reach your position in the queue.
A second incoming order executes seventy units at the same price. Twenty finish the quantity ahead, leaving fifty for your one-hundred-unit order. You now have a partial fill of fifty and fifty still resting. The two hundred units behind you remain untouched. Total incoming executed quantity was 250; the first two hundred cleared earlier priority and the next fifty reached you.
A trade at the limit is evidence of activity, not of your allocation. In this model, the size and ordering of competing quantity matter. If eighty of the units ahead had canceled before the first incoming order, only 120 would remain ahead; that first 180-unit execution would reach sixty of your units. The same trade size and price could therefore correspond to a different fill for you.
This is deliberately a simplified mechanism. Real priority can depend on order attributes, amendments, displayed versus reserve quantity or the venue’s algorithm. A feed that shows only aggregate depth may not reveal which cancellation removed quantity ahead of your order. Preserve that uncertainty instead of inventing an exact queue position from insufficient data.
A partial fill creates a real position and an unfinished intention
After the second event, fifty units have executed and fifty remain pending. A simulator that rounds this situation to fully filled exaggerates exposure. A simulator that calls it unfilled ignores a real position. Both errors can propagate into exit quantities, costs and later entry permissions.
Keep intended quantity, cumulative filled quantity and remaining quantity distinct. In the hypothetical case they are one hundred, fifty and fifty. If another thirty units execute, cumulative fill becomes eighty and remainder twenty. Any average execution price must use the actual quantities associated with each fill rather than an unweighted mean of reported prices.
For example, fifty units at 1.10000 and thirty at 1.09990 produce a weighted average of 1.0999625. That average describes the eighty executed units. It is not the price of the twenty units still waiting, and it does not prove that the entire original intention completed. A price improvement on one partial fill should not be copied onto quantity that never executed.
The remaining order and the existing position need separate accounting. Canceling the remainder does not erase the filled position. A later exit must refer to the position that actually exists, under the account’s aggregation model. A research report should reconcile this distinction even when the strategy ultimately groups partial fills into one trade episode.
This is also where fixed per-order or per-fill costs can matter. A simplified cost model may charge only proportional spread and miss costs associated with fragmented executions, if such costs apply in the target environment. Do not invent fees to make the simulation look cautious; identify the applicable schedule or keep the missing cost detail as an explicit limitation.
Cancellation is another event, not a rewind button
Return to the earlier state with fifty units filled and fifty pending; this is a separate branch from the eighty-unit weighted-price example. Suppose the robot decides to cancel the remaining fifty units after seeing a changed signal. It sends a request, but the server has not yet confirmed cancellation. During that interval, another twenty units execute. When cancellation finally applies, the account contains seventy filled units and thirty canceled units in this hypothetical sequence.
Deleting the entire original order from the research record would erase seventy units of real exposure. Treating the cancellation request as instant would erase the final twenty. The important distinction is between requesting a state change and receiving evidence that the remote system has applied it.
The FIX specification explicitly distinguishes pending cancellation from a completed canceled state. Its execution-report definition also separates the current order status from the purpose of the message. Execution Report. This supports a general reporting lesson without implying that every provider uses the same wire protocol.
Resolve fills and cancellations by their documented event semantics. Message receipt order alone may be insufficient when events arrive late or are replayed. A state summary should preserve cumulative filled quantity and identify which remainder was canceled. If the record is ambiguous, mark it unresolved rather than selecting whichever ordering produces a cleaner equity curve.
Replacing a limit with a new price introduces a related question about priority and order identity. In some mechanisms an amendment can affect priority; the exact rule is venue-specific. A backtest that repeatedly moves a limit while retaining an imagined first-in-line position needs evidence for that behavior. Otherwise its apparent fill quality may come from an assumption no real order possesses.
Candles leave more than one execution history possible
A bar gives an open, high, low and close for a specified price series and interval. It generally does not give the full ordering of quotes and executions within that interval, the quantity available at each event or your order’s priority. Many different paths can share the same four summary prices.
Suppose a hypothetical bar opens at 1.1010, reaches a high of 1.1020, a low of 1.0990 and closes at 1.1015. A buy limit at 1.1000 and a later profit target at 1.1018 both lie inside the range. One path reaches the high before falling through the entry; another fills the entry first and rises to the target afterwards. The same bar does not establish which path occurred.
The problem becomes larger when the limit is created during the bar rather than before it. Some of the range may precede order activation. The bid-ask distinction may also mean that neither the candle low nor high is the relevant executable side. Adding a simple touch rule cannot recover information the summary never contained.
Match the precision of the conclusion to the resolution of the data. A bar-based study can compare transparent fill assumptions or report ambiguous cases separately. It should not manufacture exact queue position, millisecond latency or fill sequence from four prices. Finer data can resolve some questions while still leaving provider-specific allocation uncertain.
A stricter rule is not automatically a validated rule. Requiring price to move one tick beyond the limit may reduce optimistic touch fills, but it remains a heuristic unless justified for the execution setting. It does not guarantee enough eligible quantity or prove that the order was active. State the heuristic and test sensitivity rather than presenting it as universal market law.
Missing fills can select the losing side of the sample
Non-execution is not necessarily a random deletion from a strategy’s ideal trade list. A limit that waits for a favorable entry price may be filled more readily when the market continues moving against the position, while a brief touch followed by a favorable move may leave it waiting. This is a possible selection mechanism to investigate, not a claim about every limit strategy.
Consider twenty hypothetical signals whose idealized trades include twelve winners of one hundred units and eight losers of eighty units. The ideal total is 1,200 minus 640, or 560. Now suppose only four of the twelve winners fill, while seven of the eight losers fill. The realized subset contains eleven trades and produces 400 minus 560, or minus 160.
The overall fill rate is fifty-five percent. Simply multiplying the ideal profit of 560 by 0.55 would produce 308, which is not the subset’s minus 160. That multiplication assumes a relationship between fill selection and outcomes that this constructed example does not have. A realistic investigation needs to examine which opportunities fill, not only how many.
Conditional fill behavior can change expectancy as well as trade count. Compare filled and unfilled opportunities using information available at the time: spread, volatility, quote persistence, order age and other documented conditions. Be careful when labeling the eventual outcome of an unfilled signal. That outcome belongs to a hypothetical trade path, not an actual account execution.
Track the opportunity set alongside the execution set. Without a record of eligible signals and rejected or expired intentions, the account history alone can hide selection. The research question is whether the modeled rule creates an implementable distribution of fills, not whether an ideal price entry would have been attractive after the fact.
Time in force changes which question the order asks
An order that remains active for one second is different from the same price instruction left active for a session. The longer lifetime may increase the chance of a fill, but the market context at that fill can differ from the context that produced the original signal. A historical model should preserve both the price rule and the lifetime rule.
Order labels such as immediate-or-cancel, fill-or-kill, good-till-canceled or good-till-date describe different lifetime and completion conditions, with availability and details depending on the venue or provider. Do not infer support from a generic platform screenshot. The exact instrument and order type need to permit the combination being researched.
For a hypothetical one-hundred-unit request, an immediate-or-cancel condition may allow a partial execution followed by cancellation of the remainder under the relevant rules. An all-or-nothing completion condition can lead to a different outcome for the same available quantity. The research model must state which semantics it uses instead of silently turning every price limit into an indefinitely resting order.
Expiry belongs in the signal history. If the order expires before the market reaches the limit, the later touch is not a missed execution of an active instruction. It may be a new research opportunity only if the rules generate another intention. Extending an expired order retrospectively to capture a profitable move changes the strategy.
The same applies across session closures and weekends. An apparently continuous chart can contain intervals when the target service handles orders differently or does not provide the assumed liquidity. Record the applicable calendar and lifetime policy; do not let an attractive later candle silently renew an earlier decision.
A better entry price is not the only execution objective
A limit can constrain the worst acceptable purchase or sale price under its stated execution semantics, but it can also leave the strategy without a position. A more aggressive instruction may improve completion while accepting different price risk. These are tradeoffs to study within an objective, not grounds for declaring one order type universally superior.
Use the slippage reference-price framework to define the comparison. Are you measuring deviation from the decision quote, the order-arrival quote, the intended limit or a later benchmark? A zero difference from the limit says little about an opportunity that never executed. Ignoring unfilled intentions can make a passive execution report look excellent by construction.
Measure completion and price together. A research table can include intended quantity, executed quantity, weighted execution price, waiting time and the status of the remainder. For unfilled intentions, preserve the absence of an execution price rather than assigning a favorable imaginary fill. A separate opportunity-cost analysis can be useful, but it needs its own counterfactual assumptions.
Compare policies using the same frozen signal set and consistent cost accounting. If one policy changes position occupancy, later feasible signals may differ; report whether the experiment holds opportunities fixed or replays the full decision process. Both can be legitimate questions, but they produce different interpretations.
The target is not a universally optimal instruction. It is an understanding of what the rule demands from the execution environment and whether the available evidence supports those demands. A robot whose apparent advantage disappears when non-execution is modeled may need a different entry hypothesis, not merely a more flattering fill convention.
A depth snapshot cannot explain every change in the queue
Even detailed-looking market data can leave an identification problem. Suppose a hypothetical price level shows five hundred displayed units in one snapshot and four hundred in the next. The visible reduction is one hundred. That reduction alone does not tell you whether one hundred units traded, one hundred canceled, or a mixture of trades, cancellations and newly added quantity produced the same ending total.
For example, two hundred units could have executed while one hundred new units arrived. Alternatively, fifty could have executed and fifty canceled. Both stories end with four hundred displayed units, but they imply different allocations and different remaining priority. A simulator that interprets every depth reduction as executed quantity selects one explanation without evidence for it.
Trade messages can resolve some of the ambiguity, but an aggregate feed may still not identify which cancellation occurred ahead of your hypothetical order. Returning to the earlier queue, eighty canceled units ahead improve your position; eighty canceled units behind do not. The price-level total changes by the same amount in either case. Exact queue reconstruction needs information about event identity and the applicable priority rules, not simply more frequent screenshots.
Data frequency and data completeness are different properties. A thousand snapshots per second can still omit the event identity required for a particular allocation question. Conversely, an event feed with the necessary identifiers may support a more faithful reconstruction even when the number of messages is modest. The research specification should name the information needed rather than treating a large file as proof of adequacy.
There is a second limitation when inserting an imagined order into an archived market. The original history occurred without that additional instruction. A replay may assume the hypothetical quantity is small enough not to alter subsequent behavior or price formation. That assumption can be useful for a bounded study, but it does not become true merely because the simulator runs without errors.
In the stylized FIFO example, assigning fifty units to the hypothetical order may reduce the quantity allocated to orders behind it. Their subsequent behavior is not observable in the unchanged archive. A small-order model usually abstracts from such feedback. A larger quantity or a market with limited depth may make that abstraction more consequential. Avoid claiming capacity from a replay that never models the account’s own effect on available liquidity.
The practical report should separate observed events, reconstructed state and counterfactual assumptions. If the feed supports only a range of possible queue positions, preserve a range of possible fills or a clearly labeled approximation. A single exact-looking execution timestamp can otherwise hide several unresolved choices, each of which might change the apparent profitability of a narrow entry rule.
Design a demo observation sheet before changing the simulator
A controlled demo study can compare modeled expectations with the service’s reported behavior without assuming that demo execution perfectly predicts a real account. Start by deciding what evidence to collect and which question it can answer. A vague log saying order failed will not distinguish rejection, expiry, no eligible quote, partial fill or an unresolved communication gap.
For each intention, retain a stable identifier, instrument, side, requested quantity, limit price, lifetime, decision time and sending time. Associate acknowledgments, rejections, partial fills, final status and relevant quote observations with that identifier. Preserve the difference between event timestamps and local receipt timestamps where both are available.
Collect reasons, not just success flags. If the provider reports a rejection reason, retain it without replacing it with a guessed liquidity explanation. If no reason or confirmation is available, mark uncertainty. An observation sheet should make missing evidence visible instead of converting every blank into a convenient non-fill category.
Avoid claiming more from the sample than its design supports. Ten quiet-session fills do not establish behavior during a fast event. A small demo quantity does not establish capacity at a much larger size. A feed showing quotes does not necessarily expose executable depth. These are concrete limits of transfer from the study to another environment, not reasons to abandon measurement.
Use the observations to revise a declared assumption and rerun the same research comparison. Keep the previous model, the change and its justification in the record. Otherwise a sequence of simulator improvements can become an undocumented search for whichever fill policy restores the best historical performance.
Stress the gaps without pretending to know their probabilities
When detailed evidence is unavailable, compare a small family of explicitly hypothetical fill models. One can assume eligible touches fill completely; another can require persistence or a move beyond the limit; another can impose a stated partial-fill cap. The purpose is to reveal dependence on unresolved assumptions, not to designate the strictest model as the truth.
Separate the mechanisms in those sensitivities. Changing quote side, delaying activation, limiting quantity and canceling after a shorter lifetime affect different stages. If all are changed together, a large result difference may be hard to interpret. Start with one change at a time, then examine combinations that represent coherent event sequences.
A scenario without a measured probability remains a scenario. Do not average arbitrary favorable and unfavorable cases and call the result an expected account return. An uncertainty range can communicate how much the conclusion moves across specified assumptions, but it does not automatically carry a confidence level or a forecast probability.
Audit the opportunities that change classification. If a model revision affects only a few trades that carry most of the profit, inspect those events directly. If it affects many ordinary trades, investigate the general quote and timing convention. The new profit-concentration analysis provides a way to connect execution sensitivity with the observations that dominate the research result.
Preserve failed and ambiguous cases in the report. Removing them from both numerator and denominator can make the remaining model appear accurate while hiding precisely the conditions it cannot explain. A useful simulator earns trust by making its boundary visible, including a category for evidence too coarse to decide a fill.
The conclusion should describe a chain you can verify
A well-supported fill claim links an existing intention to an active order, an eligible market condition, an allocation under the relevant mechanism and a confirmed execution record. Some research datasets support only part of that chain. The report should say which part is observed and which part is modeled.
For a bounded AI-assisted review, ask the assistant to trace one hypothetical or recorded order through those stages and list missing evidence. Require it to preserve partial quantities, distinguish bid from ask, identify events that precede activation and avoid inferring exact priority from candles. The useful output is an inspectable explanation of the documentary evidence and its limitations.
The free TradeAndRoll demo contains ten Forex systems, source material and original market CSVs for investigation. Use one system to compare a declared historical fill model with a separately observed demo workflow. A price touch is a research clue; a fill is an execution fact. Keeping them distinct makes the transition from studying rules to testing an environment more informative. Historical and simulated results cannot eliminate execution uncertainty or capital risk.



