November 30, 2026
Order routing is the path your bot's order takes after the broker receives it: to a stock or options exchange, an alternative trading system (ATS), a wholesale market maker or the broker's own inventory. That path decides who fills the order, how quickly and at what price relative to the quote your bot saw. For most retail API accounts the broker chooses the venue, not you. Before automating, read your broker's quarterly SEC Rule 606 routing report, prefer limit orders where speed is not critical, and log the quote at the moment of each order next to the fill so you can measure what routing actually costs your strategy.
This guide is for traders connecting a bot to a U.S. securities broker. It explains what you can and cannot control, how to read the public disclosures, and a simple way to measure execution quality from your own logs. It is educational research based on regulator and broker documentation, not a hands-on execution test or a broker ranking.

Many traders assume an online order goes straight to "the market." The SEC's investor guide on executing an order explains that it does not: the order goes to your broker, which decides where to send it. For an exchange-listed stock, that can be the listing exchange, another exchange, a market maker, an electronic communications network or an internal desk that fills from the firm's own inventory (internalization).
A bot adds two complications a manual trader rarely notices:
Routing cannot rescue a weak strategy. It mostly affects strategies that trade often, cross the spread with market orders, trade thinly traded symbols or depend on fast fills around news.
Brokers describe routing in different terms, but three patterns cover most bot setups.
| Approach | Who picks the venue | What it can change | Bot-builder caveat |
|---|---|---|---|
| Broker smart routing | The broker's router, using price, liquidity and fee logic | Can split or re-route an order across venues in search of a better price | Logic is proprietary; judge it by disclosures and your own fills, not marketing |
| Directed routing | You name a specific exchange or venue in the order | Control over queue placement, fees or rebates and auction participation | You take on venue choice; a poor choice can mean slower or missed fills |
| Wholesale / payment for order flow | The broker sends orders to market makers that may pay for them | Often fast fills for small marketable orders, sometimes inside the quote | Creates a conflict the broker must manage under best-execution rules; check the 606 report |
Examples from current broker documentation show the range. Interactive Brokers describes IB SmartRouting as searching exchanges and dark pools for stocks, options and combinations and re-routing all or part of an order as conditions change. Its TWS API contract object includes an Exchange field described as the exchange to which data or trades should be routed, and its API documentation lists SmartRouting option strings such as "SMART". Alpaca's payment for order flow disclosure states that it receives remuneration for directing orders to particular market centers, and its order documentation notes that market-on-open and market-on-close orders are routed to the primary exchange.
None of these structures is automatically better. Price improvement, fill rate, speed and fees trade off against each other, and the answer depends on your order size, symbols and order types.
Under 17 CFR 242.606, U.S. broker-dealers must publish a quarterly report, broken down by month, on where they route non-directed held orders in NMS stocks and non-directed customer orders in listed options. Search the broker's website for "Rule 606" or look in its disclosures library. Then check:
Routing reports show where orders went. Execution-quality statistics live in Rule 605 reports. The SEC adopted amendments that expand Rule 605 to larger broker-dealers and later extended their compliance date to August 1, 2026, so newer reports may be more comparable than older ones. Treat any broker's claim based on these reports as the broker's own interpretation and check the methodology.
Check every order type and time-in-force your bot uses against the broker's current documentation; support differs across brokers, asset classes and extended hours.
Public reports aggregate all customers. Your bot can measure its own experience if it records, for every order: the bid and ask when the decision was made (the arrival quote), the time the order was sent, each fill price and quantity, and the time of the fill or cancellation.
Hypothetical example (illustrative numbers, not a real fill): the bot buys 200 shares when the quote is $50.00 bid / $50.04 ask, so the midpoint is $50.02. The average fill is $50.035.
Track these figures by symbol, order type and time of day across many orders, and add fill rate and send-to-fill latency for limit orders. A single trade proves nothing; a few hundred orders begin to show patterns. Our guide to monitoring a live trading bot covers the operational logging this depends on.
| Question | Why it matters | Where to look |
|---|---|---|
| Can the API specify a venue, or is routing always broker-chosen? | Determines whether directed routing is even an option | API order or contract documentation |
| Which venues receive the order types my bot uses? | Shows who is likely filling marketable orders | Rule 606 quarterly report |
| Does the broker receive payment for order flow? | Reveals incentives the broker must manage | PFOF disclosure and Rule 606 report |
| Which order types and time-in-force values are supported, and when? | Unsupported instructions can be rejected or behave differently than in backtests | Broker order documentation |
| How are partial fills, cancels and rejects reported through the API? | The bot's position tracking must match the broker's records | API documentation and paper trading |
| Does paper trading simulate routing and fills realistically? | Simulated fills are usually more optimistic than live routing | Broker paper-trading notes; small live tests |
Pair this with our broader checklist for connecting a bot to a brokerage account, which covers API permissions, security and risk limits. Broker-specific setup is covered in our guides to connecting Interactive Brokers to a bot, bots for Interactive Brokers and bots for Alpaca. If you arrived looking for order-flow charting tools rather than routing, see our order flow software comparison; footprint and heatmap tools analyze the market but do not decide where your broker sends orders.
Educational research, not investment, legal or tax advice. No hands-on execution testing, broker rankings or performance results are claimed; the worked example uses hypothetical numbers. Broker capabilities and disclosures change, so confirm current terms before trading. Automated trading can lose money quickly.
Get our free Top 5 Bots for Early Retirement report plus The Bot Report newsletter — the bots we'd actually trust to compound over the long term.