Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk4 min

Simulating FX Last Look: A Broker’s Hold Window in Python

A reproducible Python toy model shows an FX request waiting through a last-look window, with distinct price and validity checks—and clear limits on what the simulation represents.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Last look is a liquidity provider’s final opportunity to accept or reject an electronic foreign-exchange (FX) trade request at the price it quoted. A small Python simulation can make the hold window visible: the request waits, a reference price changes, and the provider applies separate price and validity checks before deciding. The code below is an educational model—not a broker implementation, backtest, or statement of any provider’s current rejection policy.

What is last look in FX?

In an electronic FX market, a client may submit a request to trade against a streamed quote. With last look, the liquidity provider holds that request briefly while performing checks, then accepts or rejects it. The FX Global Code’s Principle 17 describes last look as a risk-control mechanism for validity and/or price checks, not a general-purpose option to decide whether a trade is desirable.

As an Amazon Associate I earn from qualifying purchases.

Validity check

A validity check concerns whether the request is operationally appropriate and whether sufficient credit is available. A simulation can represent this as a separate pass-or-fail condition; it should not conflate a credit or operational failure with a price movement.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Price check

A price check asks whether the requested price remains consistent with the current price available to the client. The cited guidance does not prescribe a universal tolerance or hold duration. Those values depend on the disclosed process and should be explicit parameters in any toy model. The FX Global Code sets out the principles; the GFXC’s 2021 report on last look explains the guidance in more detail.

Why was my FX trade rejected?

A rejection can follow a failed validity check, a failed price check, or both, depending on the provider’s disclosed process. During the hold, the market may move; if the provider’s price-check rule finds the request price no longer consistent with the price available to the client, the request may be rejected. A client therefore faces uncertainty while the request is pending and may bear market risk if it is not executed.

A theoretical academic model treats the hold as an option to reject after prices move. Such an option can limit a liquidity provider’s exposure to stale quotes, but rejection rules also affect traders who are not latency arbitrageurs. This is an economic model, not empirical proof of current broker practices: “Foreign exchange markets with Last Look,” Mathematics and Financial Economics (2018).

A transparent toy model of the hold window

This example uses a seeded random walk to produce a repeatable sequence of hypothetical reference prices. The client submits a buy request at the initial reference price. The simulation advances the reference price during the hold, checks validity separately, then compares the request price with the final reference price. Its chosen hold, tolerance, step size, and credit flag are illustrative inputs—not market standards or evidence about a provider.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
import random

random.seed(7)
request_price = 1.1000
hold_steps = 5
max_deviation = 0.0002
step_size = 0.0001
credit_available = True

reference_price = request_price
print(f"request: buy at {request_price:.4f}")
for step in range(1, hold_steps + 1):
    reference_price += random.choice((-step_size, step_size))
    print(f"step {step}: reference={reference_price:.4f}")

if not credit_available:
    accepted, reason = False, "validity_check_failed"
elif abs(reference_price - request_price) > max_deviation:
    accepted, reason = False, "price_check_failed"
else:
    accepted, reason = True, "accepted"

print(f"result: {'accepted' if accepted else 'rejected'} ({reason})")

The five steps stand in for elapsed time; there is no real clock, venue connection, market feed, or broker protocol. The threshold compares the request price with the last simulated reference price, and the validity branch uses a single hypothetical credit flag. Run the code as written to see one reproducible lifecycle. Change hold_steps, max_deviation, or credit_available to explore how the toy decision changes.

How to compare simulated policies without overstating them

For repeated trials, retain the same price-generation assumptions and vary one policy parameter at a time. Report the number of simulated requests, accepted and rejected counts, and each rejection reason. This makes the comparison interpretable; it does not turn the exercise into a backtest or a forecast of real rejection rates.

  • Hold duration: more simulated steps allow more price movement before the decision and keep the request pending longer.
  • Price tolerance: a smaller permitted deviation will reject more requests in this model when the reference price moves outside that limit.
  • Validity outcome: track operational or credit failures separately from price-check failures.
  • Client and provider outcomes: report fill and rejection counts. If you add an exposure measure, define exactly what it measures and label it hypothetical; the short example does not calculate one.
  • Transparency: record the parameters and reason for each decision so the simulated policy can be inspected.

These are useful educational comparison dimensions, not a GFXC scoring system. Fifty lines of Python cannot represent venue protocols, credit relationships, market-data quality, or a particular provider’s execution policy.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Why disclosure matters

The GFXC’s 2021 guidance is principles-focused, not prescriptive. It recommends fair and effective processing, better ex-ante disclosures, and information that allows clients to evaluate how trade requests are handled. A separate GFXC release says last look is intended for price and validity checks only, and encourages standardized disclosure sheets and client access to information about trading practices.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

In that 18 August 2021 release, GFXC Chair Guy Debelle said: “Liquidity consumers should then use this information to evaluate their execution, ask questions of their liquidity provider’s last look process, and evaluate whether to trade with liquidity providers that are using last look.” Read the GFXC release.

The FX Global Code is a voluntary code of good practice, not a statute; this article does not establish identical legal obligations across jurisdictions. A simulation can help explain the mechanics, but a client evaluating a real relationship needs the provider’s disclosures and information about its own request handling.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.