Stop loss · Order price
A stop triggered at $8,000 and filled at $7,950 goes through two steps
Say the account holds 10,000 USDT and this trade risks 1%, with a long opened at $9,000 and a stop triggered at 8,000: the 0.1 BTC sized from the trigger price fills at the 7,950 order price, and the real loss is 105 USDT, 1.05% of the account. The extra comes from the gap between trigger and fill; size the position from 7,950, the worst fill price, and the loss is back inside 1%.
Between setting a stop and having the position closed, there are two steps. First the market price touches the trigger price you set, and the stop is triggered; then the system sends an order into the market at the order price and size you entered beforehand. The trigger price only governs the first step. Where the order finally fills is decided in the second: by the order price, and by whatever price the market can actually fill at in that moment.
The order price can be set in two ways. Choose "Market", and when the stop triggers the order goes in at the best market price and fills immediately; OKX Learn's guide to using TP/SL adds a bracketed note after that sentence: in extreme market conditions, it may not fill immediately. Enter a specific price instead, and the triggered order behaves like any ordinary limit order, which may not fill. The guide's example of a stop that closes a long is a BTC futures long opened at $9,000, with a trigger price of 8,000 and an order price of 7,950; in brackets it suggests that, when selling, you set the order price some distance below the trigger price so the order fills immediately, or simply choose market. That $50 is price you give up in advance so the stop can actually sell.
When an OKX stop uses a market order price, the market decides the fill
A market order buys or sells right away at the best price currently available; speed is the point. The fill follows the best price on the market at the moment of the trigger and isn't bound by the trigger price, so how far it lands from 8,000 is something nobody can pin down when the order is set. Here, the stop price you chose works only as a switch.
OKX also caps the size of a single market TP/SL order for each contract, and adjusts those caps as the market changes. If your position is large, check before setting the stop that one order can hold the whole amount.
What to do when an OKX stop-limit order triggers but never fills
A limit order sets the lowest price you'll accept when selling (the highest you'll pay when buying), and the system fills at the best price within that range. A close-long order with an order price of 7,950 means: don't sell below 7,950, and sell higher if you can. Once the price drops to 8,000 and triggers it, the order fills as long as someone in the market is still buying at 7,950 or above, and the loss stays within $1,050 per BTC.
If nobody buys at that price, the order just waits. A limit order that has triggered successfully is the same as an ordinary limit order and may not fill; unfilled ones show up under open orders. Meanwhile the position is still open, the paper loss keeps moving with the market, and the stop hasn't taken you out.
If you see that the stop has triggered but the position is still there, go to open orders first and find that limit order. If the market keeps moving away from 7,950, cancel it and place a new order to close the position; if you still want to hold out for the price, at least set yourself a latest exit price, so the order doesn't hang there indefinitely.
| How the order price is set | What OKX Learn says | Worst price to use when sizing |
|---|---|---|
| Market | Goes in at the best market price and fills immediately when triggered; bracketed note: may not fill immediately in extreme market conditions | No floor: pick a price you're willing to accept and use that; the further away it is, the smaller the position |
| Limit (7,950 in the close-long example) | Once triggered, same as an ordinary limit order and may not fill; when selling, set the order price some distance below the trigger price | Use the order price, 7,950, provided it fills; any part left hanging unfilled is outside the formula |
OKX two-way TP/SL freezes only one side, and one side triggering cancels the other
OKX Learn's long-position example of two-way TP/SL is a BTC long opened at $9,000 with both a take-profit and a stop-loss attached: a rise to 10,000 triggers the take-profit, a drop to 8,000 triggers the stop. Either side's order price can be set to market or to a specific price, here 9,950 for the take-profit and 7,950 for the stop. When the price rises to 10,000 and the take-profit triggers, the stop at 8,000 is cancelled automatically; when it drops to 8,000 and the stop triggers, the take-profit at 10,000 is cancelled automatically.
While they're pending, TP/SL orders freeze margin or position. A two-way order freezes only one side, and keeps it frozen until it triggers, so before doing anything else on the same position, check how much is still available. If either side uses a limit price, go back to open orders after it triggers and check two things: whether the triggered order filled, and whether the other one is still there.
Size the position from the worst fill price, not the trigger price
Once you've fixed the planned loss per trade, work the position size backwards with this formula: quantity = money you're willing to lose on this trade ÷ |entry price − stop price|. Replace the stop price in that formula with the worst fill price you're prepared to accept, and the margin of safety is built into the arithmetic.
Plugging in the prices from OKX's example, and assuming an account of 10,000 USDT, a planned loss of 1% per trade (100 USDT) and a long opened at $9,000, before fees:
- Sized from the 8,000 trigger price: 100 ÷ (9,000 − 8,000) = 0.1 BTC.
- If that 0.1 BTC fills at the 7,950 order price: actual loss 0.1 × (9,000 − 7,950) = 105 USDT, or 1.05% of the account.
- Sized from 7,950: 100 ÷ 1,050 ≈ 0.0952 BTC, which loses about 99.96 USDT when filled at 7,950, back inside 1%.
For a limit order, the worst fill price is the order price you entered, provided it fills. A market order has no such floor, so the worst price is a number you have to choose yourself; the further away you set it, the smaller the position that comes out. That number is what goes into the stop price field of the Position size calculator.
The formula covers fills that land within the range you expected; a limit order left unfilled with the position still open is outside it. How far the trigger price should be from your entry is a question for How to set a stop loss that doesn't keep getting wicked out; how much further the fill might slip is what the formula above is for.
What else can keep an OKX stop-loss from closing your position as planned
Why didn't my stop-loss order go through after it triggered?
OKX Learn lists causes such as position limits, insufficient margin, the contract being in a non-trading state and system issues: a TP/SL order may not trigger successfully, and may fail to be placed in situations like these. Having a stop set doesn't guarantee an order will reach the market when the time comes; when the market moves fast, confirm that it really did turn into an order.
Should a short's stop-loss order price be above or below the trigger price?
Above it, by some margin. OKX's example of a stop that closes a short is a short opened at $9,000, with a trigger price of 10,000 and an order price of 10,050; in brackets it suggests that, when buying, you set the order price some distance above the trigger price, or choose market. Closing a short is a buy and the limit is the most you're willing to pay, so the margin goes upward.
Do OKX trigger orders freeze margin?
According to OKX Learn's article on order types, trigger orders don't freeze account assets, while TP/SL orders freeze them in advance. The catch with a trigger order comes at the moment it triggers: if your available balance covers less than the order size, the order is placed for what the balance can cover; if that's below the minimum trade size, the order simply fails.
Risk note
The order rules here apply only to OKX's TP/SL orders. This is not investment advice and recommends no specific asset or platform. Futures carry leverage, and when a stop doesn't fill as expected, losses can exceed the plan. The sizing formula leaves out fees, so real fills will differ somewhat.