BullsEdges algo trading guide: Every trade starts with an order type. Learn how market, limit and stop orders work, when each one fills, and which one your strategy should use.
The order type decides when and at what price a trade is opened or closed. Choosing the right one affects cost, fill quality and even whether the trade happens at all.
BullsEdges algo trading application: Select order types for the entry logic and model their actual triggers, bid-ask prices and possible slippage.
Market orders
Buy or sell immediately at the best available price.
- Fills: almost always, but the price is not guaranteed. In fast markets, slippage can be significant.
- Use when: the strategy needs to be in the trade now, such as a signal on bar close.
Limit orders
Buy below the current price or sell above it - at a better price than now.
- Buy limit: placed below the market; fills if price falls to it.
- Sell limit: placed above the market; fills if price rises to it.
- Fills: at the limit price or better, but only if price reaches it. In fast moves it may not fill at all.
- Use when: you want to enter on a pullback, or for take-profit levels.
Stop orders
Buy above the current price or sell below it - entering in the direction of movement.
- Buy stop: placed above the market; triggers if price rises to it.
- Sell stop: placed below the market; triggers if price falls to it.
- Fills: once triggered, it becomes a market order, so slippage is possible.
- Use when: trading breakouts, or as a stop loss.
Stop-limit orders
MT5 also offers buy stop limit and sell stop limit orders: when the stop price is reached, a limit order is placed instead of a market order. This controls slippage but risks not filling.
Stops level and freeze level
Brokers set a minimum distance between the current price and pending orders, stop losses and take profits. Orders placed closer are rejected with "invalid stops". A freeze level may also prevent modifying orders that are very close to execution. EAs must check these values.
Which price triggers what
- Buy orders fill at the ask; sell orders fill at the bid.
- A buy position's stop loss and take profit trigger on the bid; a sell position's on the ask.
This is why spread spikes can hit sell stops even when the bid never moved there.
OCO: one cancels the other
Some strategies place two pending orders at once - for example a buy stop above and a sell stop below. When one fills, the other must be cancelled. MT5 does not do this automatically for most retail accounts; the EA must handle it, and should also handle the rare case where both fill in one spike.
BullsEdges takeaway for algo trading
Market orders give certainty of execution, limit orders give certainty of price, and stop orders give entry into momentum. Choose based on what the strategy needs most, and always account for the spread and stops level.
Trading forex and gold carries a high level of risk and may not be suitable for every investor. Past performance and backtests do not guarantee future results. This article is education, not financial advice.
