Limit vs market order: certainty of price, or certainty of a fill
One guarantees a fill, the other guarantees a price. How each behaves on CodeBull, and where a simulator differs from an exchange.
You open the order ticket and it offers five tabs: Market, Limit, Stop, Stop Limit and Trailing. Each tab shows a line on what it does, but nothing tells you which one to pick. A free account places the first two, Market and Limit, and the difference between them comes down to one trade-off.
The trade-off in one sentence
With a market order you choose to be filled, and the market chooses the price. With a limit order you choose the price, and the market chooses whether you get filled.
Everything else follows from that.
Market order
A market order says fill me now, at whatever the market is offering. On CodeBull a market buy fills at the ask and a market sell fills at the bid. Both are set from the last traded price: the ask 0.05% above it, the bid 0.05% below.
An illustrative quote: bid 99.95, ask 100.05, last trade 100.00. Buy one share at market and you pay 100.05. Sell it straight back at market and you receive 99.95. You have lost 0.10 without the price moving at all. That gap is the spread. Each market order pays half of it, measured from the midpoint of 100.00, so a round trip at market pays all of it.
The number in the ticket's header is the last traded price, not the ask. To see what a market order will actually cost, click Details on the instrument's card: it shows the bid, the ask and the spread between them.
A market order is the right call when getting in (or out) matters more than the last few cents, and the spread is small next to what you are trying to capture. In a real market that depends on the stock: a heavily traded one usually has a narrow spread, a thinly traded one can have a wide one, and a market order pays its share however wide it is. On CodeBull the spread is the same for every instrument (more on that below).
Limit order, and which side of the market it goes on
A limit order sets the worst price you will accept. A buy limit is the most you will pay. A sell limit is the least you will take.
Where you put that price relative to the quote decides what happens next:
- Buy limit below the ask. It waits. Nothing happens until the ask comes down to your price.
- Buy limit at or above the ask. It is marketable and fills straight away. On CodeBull it fills at your limit, not at the ask (more on that below).
- Sell limit above the bid. It waits until the bid rises to your price.
- Sell limit at or below the bid. It fills straight away, again at your limit rather than at the bid.
The ticket's Price field starts empty and gives no hint which side of the market you are on, so check the ask (for a buy) or the bid (for a sell) before you type a number.
A limit order is the right call when you have a price in mind and would rather miss the trade than pay more. Its cost is not money. It is the fills you don't get.
Place one of each
Two minutes, one share each, simulated money:
- Create a free account if you don't have one, open Instruments and pick a stock. Click Details and note the bid and the ask.
- Click Buy, check that the ticket is on Market (it opens on the
last type you used), enter a quantity of
1and place the order. The confirmation reads Simulated fill with the price you paid. Unless the quote refreshed in between, it matches the ask you noted to the cent. Details rounds to two decimals and the confirmation shows four. - Back on the same stock's card, click Add. Now that you own a share,
it takes the place of Buy. Switch the ticket to Limit, enter a
quantity of
1and a price a little below the ask, then place it. This time the confirmation says Order accepted: pending, resting in the book. - Go to Portfolio, then Open Orders. Your limit is there with its price. Leave it to see whether the market comes to you, or cancel it.
One filled and one waited. That's the whole difference, and now you've seen it happen.
Where CodeBull differs from a real exchange
Everything above holds in any market. This section is specific to a simulator, and it is the part a brokerage glossary has no reason to write. It covers orders placed from the ticket. Strategy backtests fill through a different path.
Your limit fills at your limit, never better. On an exchange, a buy limit at 101 with the ask at 100.05 fills at about 100.05, because the limit is only a cap and you get the better price. On CodeBull it fills at 101. So don't set a limit far through the market as a "market order with a safety cap" here: you will pay the cap. If you want a limit that fills straight away, set it at the price you actually want to pay. This one works against you.
A touch is a fill. When the quote reaches your limit, your whole order fills at once. On a real exchange you join a queue behind everyone already waiting at that price, and the price can touch your level and leave before your turn comes. You might get part of your order, or none of it. This one flatters you: a limit strategy that always gets filled here would get filled less often in a real market.
Resting orders are checked when quotes refresh. They are not checked on every trade. A quick dip to your price and back between two refreshes never fills you, even where a real exchange might have.
The spread is the same for every instrument. The bid and ask always sit 0.05% either side of the last price, so a market order pays the same 0.10% round trip on a heavily traded stock as on a thinly traded one. In a real market the spread on a quiet stock can be much wider, and it widens further at the open and around news. This one flatters market orders, most on the stocks where a real spread would be widest.
There are no trading hours. A market order placed at 3 a.m. fills straight away, priced off the last price the feed provided. At most brokers it would wait for the open and fill at whatever the opening price turned out to be, which can be a long way from the previous close.
Your order doesn't move the price. However many shares you buy, they all fill at the same price. A real order larger than what is on offer at the best price works through the queue of sellers, and the price moves against you as it goes. Paper trading, explained covers where else the simulation ends.
For one share of a liquid stock, none of these makes much difference. They start to matter when you build a strategy around limit orders or trade in size.
What about Stop, Stop Limit and Trailing?
They are the other three tabs, and they solve a different problem: getting you out when the price moves against you. Stop comes with Starter. Stop Limit and Trailing come with Pro. They get a separate post.
Which one for your first order
Market, one share. You'll see a fill, the price you paid and the position in your portfolio. Then place a limit below the ask, so you've also seen an order wait.
Neither type is the better one. The question for any trade is which guarantee you need: the fill, or the price. This article describes how two order types behave. It is not a recommendation to buy or sell anything.
Educational content, not financial advice. Every order on CodeBull is placed with simulated money against quotes from a third-party feed, and nothing is sent to a real exchange.