Futures order types: market, limit, stop, and how a backtest fills
Futures order types trade certainty of a fill against certainty of a price. A market order fills now at any price, a limit order fills only at your price, a stop becomes a market order at a trigger and a stop-limit becomes a limit order there. A sound backtest fills on the next bar's open with slippage, and limit orders are the ones to trust least.
By Soren Huang · Published · updated · Editorial policy
Contents
- What are the four futures order types and when do you use each?
- What is the difference between a limit order and a market order?
- Does a stop order get filled through a gap?
- How does a backtest fill these orders? Next-bar execution and slippage
- What can a backtest not show about queues and partial fills?
- Which order types should an automated rule use before you export it?
- Frequently asked questions
- References
What are the four futures order types and when do you use each?
Futures order types come down to four: a market order trades now at the best available price, a limit order trades only at your price or better, a stop order becomes a market order once price touches a trigger, and a stop-limit order becomes a limit order at that trigger. Each choice trades certainty of a fill against certainty of a price.
A market order is an instruction to buy or sell immediately at whatever price the other side of the book offers. A limit order is an instruction to buy at or below a stated price, or sell at or above it, and to wait if the market is not there. A stop order is a resting instruction that stays inactive until a trade occurs at or through a trigger price, then turns into a market order. A stop-limit order is the same resting instruction, but at the trigger it turns into a limit order with a price cap you set.
Think of buying a used car. A market order is paying the asking price today and driving away. A limit order is leaving your phone number and a maximum price: you may get the car cheaper, or someone else may buy it first. A stop order is telling a friend "if the price ever drops to this level, buy it for me at whatever it costs then." A stop-limit is the same instruction with "but not more than this."
| Order type | What triggers it | Fill certainty | Price certainty | Typical use in a rule |
|---|---|---|---|---|
| Market | Sent at once | High | Low | Entry or exit that must happen now |
| Limit | Price reaches your level | Low | High | Entry on a pullback at a chosen price |
| Stop | Trade at or through trigger | High after trigger | Low | Protective exit, or breakout entry |
| Stop-limit | Trade at or through trigger | Low after trigger | High | Breakout entry with a cap on the entry price |
Some exchanges add a protection range to market and stop orders, so a fill cannot run more than a set distance from the trigger; past that distance the rest of the order rests as a limit. Read the order-type page of the exchange you trade before you assume the textbook behaviour. The rest of this article argues one thing: for an automated rule, a missed trade is usually the more expensive error, so entries belong on market or stop orders with slippage charged, and limit-order fills are the part of a backtest to trust least.
What is the difference between a limit order and a market order?
A market order makes the fill certain but not the price, a limit order makes the price certain but not the fill, and which one a rule should use depends on whether missing the trade or paying a worse price hurts the strategy more. The difference is where the order sits on the price ladder.
The price ladder is the list of bids below the last trade and offers above it. A buy market order crosses the ladder and takes the best offer at once. A buy limit order placed below the best bid joins the queue there and waits. If price comes down to it and enough contracts trade, it fills at your price. If price turns up before that, you have no position while the move you wanted happens without you.
Which error hurts more depends on the type of rule. Breakout and trend-following rules make most of their result on a small number of trades that run far, so a missed entry removes exactly the trades the strategy lives on. Mean-reversion rules enter when price has already moved against the trade, so waiting at a limit costs little and a worse fill matters more. The five rule families in futures algo trading strategies and how to backtest each split along this line.
Hypothetical example
Suppose a breakout rule averages $300 per trade over 200 trades. Switching entries from market to limit orders saves one tick per entry, say $5 per trade, or $1,000 in total. But the limit orders miss 15 percent of the entries, and the missed trades are the fast ones, averaging $900 each. Thirty missed trades at $900 cost $27,000. The saving of $1,000 is small next to that. For a mean-reversion rule that averages $150 per trade and rarely misses a fill at the limit, the same switch could pay.
Does a stop order get filled through a gap?
A stop order fills through a gap at the first available price beyond the trigger, often far from it, while a stop-limit order may not fill at all, so a protective stop and a stop-limit behave very differently on the Sunday reopening or after news. A gap is a jump in price between one trade and the next with no trades in between.
When the market reopens below a sell stop, the stop triggers on the first trade at or through its price and becomes a market order. The market order fills at the price available then, which is the opening level, not your trigger. The stop did its job: the position is closed. It did not do it at the price you wrote down. A sell stop-limit with a cap close to the trigger triggers at the same moment, but its limit sits above the market, so it rests unfilled while the position stays open and keeps losing.
Hypothetical example
A long position has a sell stop at 5000. The market closes at 5012 and reopens at 4980. The stop triggers on the first trade at 4980 and fills there, 20 points below the trigger. On a contract worth $20 per index point, that is $400 per contract beyond the planned loss. A sell stop-limit at 5000 with a limit of 4998 triggers at the same first trade, but the limit of 4998 is above the market, so it does not fill. If price keeps falling to 4950, the position is still open and the loss is now 50 points.
Gaps are not only a weekend event. Equity index futures trade nearly around the clock, and the thin hours are where a trigger can be touched on a few contracts and the next trade is several ticks away; futures sessions in a 24-hour backtest explains which hours the bars cover. The overnight stretch described in after-hours trading hours, liquidity and backtest pitfalls and the early closes listed in Christmas Eve market hours and your backtest are the times to look at first in your trade list. The joint CFTC and SEC report on 6 May 2010 describes stop-loss orders that became market orders and filled far below their triggers as prices fell, the same mechanism on a larger scale. How to place a protective stop and what to expect from it is covered in what a stop loss order is and how it works on futures.
How does a backtest fill these orders? Next-bar execution and slippage
A sound backtest decides on the close of one bar and fills at the open of the next bar, then charges commission and slippage on every fill, and the ES run shown here is one example of a rule tested with exactly those assumptions. Next-bar execution is the rule that an order created from a bar's close can only trade on the bar that follows.
The reason is simple. A rule that reads the closing price cannot know it until the bar has closed, and by then the close is gone. Filling at that same close uses a price the rule could not have traded at. Filling at the next open is the earliest honest moment. Slippage is the difference between the price the backtest assumed and the price a real order would have received, and it is charged on top of the fill, usually as a fixed amount per side or per trade.
- Market order in a backtest: fills at the next bar's open, plus slippage.
- Stop order in a backtest: fills at the trigger price on the bar that trades through it, plus slippage, or at that bar's open if the bar opens beyond the trigger (the gap case above).
- Limit order in a backtest: fills at the limit price on the bar that reaches it. Whether "reaches" means touched or traded through is a setting, and the next section explains why it matters.
- Stop-limit order in a backtest: fills only if the bar after the trigger trades within the limit; otherwise the order stays open.
How large should slippage be? One tick per side is a common starting point for liquid index futures with market or stop orders, and more for thin hours. On E-mini Nasdaq-100 futures the minimum tick is 0.25 index points, worth $5.00 per contract (CME Group). Exchanges can change tick sizes and contract values, so confirm them on the exchange's contract page; the free futures contract calculator turns a tick count into dollars for the contract you test.
The run below is one example of these assumptions in use. It tested ES daily bars from 2019-01-02 to 2025-06-30, long and short with one contract, with $20 commission and $25 slippage charged on every trade and fills on the next bar. The rule is a stand-in: a Highest and Lowest breakout as its only entry and exit, with no stop, no target and no filters, built from standard indicators rather than from the order types this article is about. The result is the one candidate the search kept out of about a thousand candidates (1,024) it tried, chosen for its return against its drawdown. Picking the kept one after the fact flatters it; the other candidates did worse on the same data, and nothing here says the rule earned that money or that a reader can expect it. What the box shows is how a report reads when every fill already carries next-bar execution and costs. AlphaPrime (Valynox) applies these settings inside each candidate's backtesting, so the net profit of $110,185 and the max drawdown of $64,017.5 in the box are after the $20 and $25 on each of the 92 trades, not before.
Source: AlphaPrime product engine (CPU), run 2026-10-31. ES daily bars, 2019-01-02 to 2025-06-30, long and short, 1 contract, $20 commission and $25 slippage per trade.
| Number | Result |
|---|---|
| Net profit (closed trades) | $110,185 |
| Max drawdown | $64,017.5 |
| Trades | 92 |
| Win rate | 71.74% |
| Profit factor | 1.886 |
| Average trade | $1,197.66 |
| Time in market | 89.09% |

Two readings from the box matter for order types. The average trade of $1,197.66 is many times the $45 of commission plus slippage, so doubling the slippage would not change the sign of the result; a rule with an average trade of $60 on the same costs would be a different story. And the time in market of 89.09% means the rule is almost always holding a position, so nearly every entry is also an exit, and each one pays the cost once.
What can a backtest not show about queues and partial fills?
Bar data has no order book, so a backtest cannot know your place in the queue at a limit price, whether only part of a multi-contract order filled, or how long a fill took, which is why limit-order strategies need the most conservative fill assumptions. A bar records only open, high, low, close and volume; it says that price visited a level, not that your order traded there.
Queue position is your place in the line of orders resting at one price, counted from the earliest. Orders at a price fill in the order they arrived. If 300 contracts were ahead of yours at a limit price and only 120 traded there before price moved away, your order did not fill. The bar shows a low that touched the price, so a backtest set to "fill when touched" counts the trade. A partial fill is an order for several contracts of which only some traded; the bar cannot show that either.
Three settings make a backtest honest about this:
- Count a limit fill only when price trades through the level by at least one tick. If the bar's low is exactly your buy limit, treat the order as not filled. This removes the fills that depend on queue position.
- Charge slippage on limit fills too, or at least on limit exits. It feels wrong, because a limit order cannot fill worse than its price. But the trades it misses behave like a cost, and a flat charge is a plain way to carry that cost into the result.
- Scale slippage with contract count. One contract takes the best price; ten contracts may walk several levels of the book. A backtest that fills ten at the same price as one is optimistic in the exact trades that matter most.
The order of magnitude to expect: on the daily ES bars in the box above, fills on the next open with a $25 charge are a reasonable picture of a one-contract market order. On one-minute bars, limit entries and ten contracts, the same report would need all three settings before the net profit line meant much.
Which order types should an automated rule use before you export it?
Keep the order types in the rule the same as the ones the backtest modelled, prefer market or stop orders for entries that must not be missed, and check how each target platform maps the exported order before the first live session. A rule tested with next-open market fills and then run live with limit entries is a different rule, and its backtest no longer describes it.
| Order type in the rule | How the backtest fills it | Main live risk | What to verify on the platform |
|---|---|---|---|
| Market | Next bar's open plus slippage | Worse price | Slippage setting matches your live fills |
| Limit | Only if price trades through the level | No fill | Touch versus trade-through rule in the tester |
| Stop | Next bar after trigger plus slippage | Gap | How the platform submits and holds stops |
| Stop-limit | Only if the fill is within the limit | No fill | Limit offset and what happens when it is missed |
Platforms differ in how they turn a strategy's order into an exchange order: whether a stop is held on the exchange or on your machine, whether a limit is treated as filled when touched in the tester, and what offset a stop-limit uses. AlphaPrime exports strategy source code to MultiCharts (PowerLanguage), TradingView (Pine Script v6), TradeStation (EasyLanguage), NinjaTrader (NinjaScript), MetaTrader 4 (MQL4) and MetaTrader 5 (MQL5); the order types the exported rule uses stay the ones the search tested, and the current list of supported platforms is kept on the platform export page, so after the import your first job is to read how that platform's tester fills each of them. The steps before the first live session:
- Write down the order type of every entry and exit in the rule and confirm it matches the backtest's fill assumption from the table above.
- Run the imported strategy in the platform's own tester on the same bars and compare trade dates and fill prices with your report; differences usually point to a touch-versus-trade-through or slippage setting.
- Trade one contract live for a few sessions and record the fill price next to the signal price for each order. The average gap between them is your measured slippage.
- Put the measured slippage back into the backtest and rerun. If the result changes sign, the rule was depending on cheap execution.
The number to check next is in your own trade list: count how many entries in your last backtest were limit orders filled at a bar's exact high or low, switch the tester to require trade-through, double the slippage, and read the net result again before you export anything.
Frequently asked questions
How do you use a stop-limit order in futures?
A stop-limit order rests until a trade occurs at or through its trigger price, then becomes a limit order at the limit price you set. It is used when you want to enter a breakout but refuse to pay more than a set distance beyond the trigger. For a protective exit it is risky, because after a gap the limit may sit on the wrong side of the market and the position stays open. Use it for entries you are willing to miss, not for exits you must get.
Which order type does a backtest fill with?
Most backtests model a market order that fills at the open of the bar after the signal, with a slippage amount added per side or per trade. Stop orders fill at the trigger on the bar that trades through it, or at that bar's open when it opens beyond the trigger. Limit orders fill at the limit price on the bar that reaches it, and the honest setting counts the fill only when price trades through the level, not when it touches it.
Can a limit order fill at a better price than the limit?
Yes. A limit order sets the worst price you accept, not the exact price. A buy limit sent when the market is already below your price fills at the better market price. In a backtest this appears when a bar opens through the limit level: the fill is recorded at the open, which is better than the limit, and that is the correct treatment.
What is slippage in a futures backtest?
Slippage is the difference between the price the backtest assumed for a fill and the price a real order would have received. It is charged as a fixed amount per side or per trade, on top of commission. One tick per side is a common starting point for liquid index futures with market or stop orders, with more for thin hours and for orders of several contracts. Doubling the slippage and rerunning shows how much the result depends on cheap fills.
References
- U.S. Securities and Exchange Commission. Understanding Order Types (Investor Bulletin). https://www.investor.gov/introduction-investing/general-resources/news-alerts/alerts-bulletins/investor-bulletins-14
- U.S. Securities and Exchange Commission. Stop, Stop-Limit, and Trailing Stop Orders (Investor Bulletin). https://www.investor.gov/introduction-investing/general-resources/news-alerts/alerts-bulletins/investor-bulletins-15
- Staffs of the CFTC and SEC (2010). Findings Regarding the Market Events of May 6, 2010. Report to the Joint Advisory Committee on Emerging Regulatory Issues, September 30, 2010.
- CME Group. E-mini Nasdaq-100 Futures Contract Specs. https://www.cmegroup.com/markets/equities/nasdaq/e-mini-nasdaq-100.contractSpecs.html

