Direct answer
When you use an API for forex trading, the total cost is not only the spread you see in a quote. You should check (1) published trading cost components such as spreads and commission schedules, and (2) variable execution outcomes such as slippage and partial fills that change what you actually pay. A useful goal is to be able to explain, in your own words, which part is “published pricing” and which part is “variable outcome.”
Mechanism or definition
Start by defining three terms:
- Spread: the difference between the displayed buy and sell prices at the time you request execution.
- Commission and order fees: explicit charges (for example, per trade, per million units, or per order) that may be separate from the spread.
- Execution outcome: the realized prices and fills produced when your order reaches the matching and execution system.
For API brokers, the API may let you request quotes, place orders, and retrieve execution reports. The mechanics that matter for cost are how the system:
- provides quotes and spreads,
- applies commissions/fees when execution is reported,
- reflects fills, re-quotes, rejects, and cancellations.
A common calculation separates expected transaction cost from realized transaction cost. Expected cost uses published spread and stated fee schedule, while realized cost also includes execution effects such as slippage.
Evidence or example (with clear assumptions)
Assume the following, purely as an example: you trade a notional amount where the quoted spread is 1 pip at the moment you place the order, and the broker publishes a commission that is fixed per trade. Your expected cost can be modeled as:
- spread component (from the quote at request time), plus
- commission component (from the schedule applied to that order).
Now introduce a variable execution outcome assumption: by the time the broker executes, the market moves and your trade gets filled with slippage of 0.5 pip compared with the quoted mid or expected entry reference (the exact reference depends on the platform’s reporting). Then your realized cost becomes:
- spread component adjusted for slippage, plus
- commission component (if it still applies the same way).
The key point is not the numbers, but the separation. If you cannot map the API’s execution report fields to “spread/fee inputs” and “execution effects,” you will not be able to independently verify how much cost came from published pricing versus variable market/provider conditions.
Limitations and risks (material failure modes)
At least one material limitation is that costs may be reported differently across quote time, order placement time, and fill time. This can cause misunderstandings when you compare “what you expected from a quote” to “what you actually paid in the execution report.”
Another common failure mode is non-execution or partial execution. If the API rejects an order, re-quotes, cancels, or fills only part of the requested size, your fee and spread exposure may differ from what you modeled.
Also consider that some cost categories may be not part of the intraday spread but still affect total economics, such as overnight financing/funding effects, conversion-related charges, or inactivity fees. Since these can depend on instrument and contract terms, you must treat them as separate inputs rather than assuming they are included in the spread.
Finally, outcomes vary with market conditions, costs, execution, and jurisdiction. Historical relationships do not establish future results.
Verification or next question
To verify independently, do two checks:
- Cost mapping check: confirm which API fields correspond to quote prices, executed fill prices, and the fee breakdown shown in the execution report (including any references to commissions or trade charges).
- Expectation vs realization check: run small, controlled test orders and compare your modeled cost components (spread + stated fees) with the realized reported outcomes.
Next, ask what specific fee categories and execution behaviors are documented for the API you plan to use: commission basis, how spread is expressed, how partial fills are charged, and what happens on rejects/cancellations. If any of these are unclear, your ability to verify total cost is limited.