3 Common Order Types You Should Know
Economy & Market
There are 3 order types that are commonly used in securities trading, namely
- Market Order
- Limit Order
- Stop Order
Different order types can result in vastly different outcomes. It is important to understand how they differ and when to consider each.
What is Market Order?
A market order is to buy or sell at the best available price in the current market. A market order typically ensures an execution, but it does not guarantee a specified price. It is appropriate to use market orders when you want an immediate execution.
A market quote typically includes the highest bid (for sellers) and lowest offer (for buyers). That is, when opening a buy (sell) position using market order, it will try to execute at the best ask (bid) price.
Market orders should be placed during market hours. When markets are closed, placing a market order would either be executed at the next market open or simply rejected by the trading system, depending on your broker's system design. For the previous case, the final execution price could be significantly different from its prior close because many factors can impact the security's price between market sessions, such as the release of earnings, company news, or economic data.
What is Limit Order?
A limit order is to buy or sell with a condition on the maximum price to pay or the minimum price to receive (the "limit price"). If the order is filled, it will only be at the specified limit price or better. However, there is no guarantee of execution. A limit order may be appropriate when you think you can buy at a price lower than (or sell at a price higher than) the current market quote.
From the example below, the last trade price is roughly $138
- investor who wants to buy (or sell) immediately would place a market order, which would be executed at or near the current price of $138 (white line) provided that the market was open.
- investor who wants to buy the stock when it dropped to $131.78 would place a buy limit order with a limit price of $131.78 (green line). If the price falls to $131.78 or lower, the limit order would be triggered and executed at $131.78 or below. If the stock doesn't drop to $131.78 or below, no execution would occur.
- investor who wants to sell the stock when it reached $143.82 would place a sell limit order with a limit price of $143.82 (red line). If the price rises to $143.82 or higher, the limit order would be triggered and executed at $143.82 or above. If the stock doesn't rise to $143.82 or above, no execution would occur.
A few points to pay attention for using limit orders:
- Limit orders are generally executed on a first-come-first-served basis. Even if the price reaches the specified limit price, your order may not be filled, because there may be orders ahead of yours that eliminate the availability of shares at the limit price. Further reading about order book mechanism can refer to this article.
- The price at which the limit order is executed can be lower (higher) than the limit price for a limit buy (sell) order.
- If the limit price is set far away from the current price, the limit order will be unlikely to get fill and hence would still be in effect until we cancel it.
What is Stop Order?
A stop order is to buy or sell at the market price when it has traded at or through a specified price (the "stop price"). If the stock reaches the stop price, the order becomes a market order and is filled at the next available market price. If it doesn't reach the stop price, the order will not be executed.
A stop order may be appropriate in these scenarios:
- you want to buy when a stock breaks out above a certain level, and believe that it will continue the trend
- your holding stock has risen a lot and you want to protect the gain when it begins to fall
The chart looks similar to the previous one, but the red and green line just reverse. The stop buy order will trigger when the price reaches 143.82 or above, and will execute as a market order at that current price. Thus, if the price rise further after hitting the stop price, it is possible that the order could be executed at a price higher than the stop price. Similarly for the stop sell order, once the stop price of $131.78 is hitted, the order could be executed at a lower price.
How to implement on ALGOGENE?
ALGOGENE is a modern design algorithmic trading platform that provides the feasibility of various order types, including market, limit and stop order.
For market order, we just need to set 'ordertype' to 0.
1 2 3 4 5 6 7 8
order = AlgoAPIUtil.OrderObject( instrument = 'EURUSD', openclose = 'open', buysell = 1, #1=buy, -1=sell ordertype = 0, #0=market, 1=limit, 2=stop volume = 0.01 ) self.evt.sendOrder(order)
For limit order, 'ordertype' sets to 1, and 'price' sets to your desired limit price
1 2 3 4 5 6 7 8 9
order = AlgoAPIUtil.OrderObject( instrument = 'EURUSD', openclose = 'open', buysell = 1, #1=buy, -1=sell ordertype = 1, #0=market, 1=limit, 2=stop volume = 0.01, price = 1.01 ) self.evt.sendOrder(order)
For stop order, 'ordertype' sets to 2, and 'price' sets to your desired stop price
1 2 3 4 5 6 7 8 9
order = AlgoAPIUtil.OrderObject( instrument = 'EURUSD', openclose = 'open', buysell = 1, #1=buy, -1=sell ordertype = 2, #0=market, 1=limit, 2=stop volume = 0.01, price = 1.9 ) self.evt.sendOrder(order)
Now, you learnt the difference between market order, limit order and stop order; and got some basic understanding when to consider each.
Happy Trading! :)