Limit Order Strategy (Backtest And Example)
Last Updated on January 13, 2023
Different order types can result in vastly different outcomes, which is why it is important to understand the type of order you use. If you want your order to be filled at your specified price, go for a limit order. But what is a limit order strategy?
A limit order strategy is an order to buy or sell a security at a specific price or better. It comes with a specification of the maximum price to be paid or the minimum price to be received, known as the “limit price”.
In this post, we take a look at the limit order strategy, and at the end of the article, we make a backtest of a limit order strategy.
What is a limit order?
A limit order is an order to buy or sell a security at a specific price or better. It comes with a specification of the maximum price to be paid or the minimum price to be received, and this is known as the “limit price”. The limit order is usually placed away from the current market price, and it sits there waiting for the price to reach the specified level.
When the order is filled, it will only be at the specified limit price or a better price. So, it gives the trader more control of the price they get in at. However, there is no assurance of its execution, as the price might not get to the specified price, resulting in missed trading opportunities. While a limit order may be appropriate when you think you can get in at a better price, you may end up missing the trade entirely.
It is also important to note that for many brokers, a limit order is usually valid for a specific number of days until the order is filled or until the trader cancels the order.
Types of limit orders: buy limit order and sell limit order
There are two types of limit orders: the buy limit order and the sell limit order.
A buy limit order is an order to buy a security at the specified limit price or lower. The order is placed below the current market price with the hope that the price will fall lower to its level and then reverse.
A sell limit order, on the other hand, is placed above the current market price and can only be executed at the specified limit price or higher.
An example of a limit order (buy and sell limit order)
Let’s say Apple Inc’s (AAPL) stock is trading around $150 per share, and you believe it could fall to $130 in the coming days or weeks. You can set a buy limit order to purchase the stock at $130 per share, good ’til canceled. The order will remain open until the stock reaches the specified limit price, and your order gets filled at $130 or lower, or you cancel the order.
Similarly, if you want to sell Microsoft Corp.’s (MSFT) stock but think that its current price of $237 per share is too low and believe that it could rise to $300 per share in the coming weeks, you can set a sell limit order at $300. When the price rises to that level, your order will be filled at $300 or higher.
Which is better — stop or limit order?
It depends on what you want:
A limit order will only be filled at the specified limit price or better; whereas once a stop order triggers at the specified price, it will be filled at the prevailing price in the market so that it could get filled at a worse price.
The limit order gives you control of the price to get in at but there is no assurance of execution with limit orders. It may not be triggered before the market turns and makes the anticipated move, making you miss the move. On the other hand, the stop order allows you to get in along the momentum. If it doesn’t trigger, it means the expected move never happened and you won’t miss out on anything.
Limit orders can be seen in the order book, so the market can see your order and the anticipated move. Stop orders can’t be seen by the market, allowing you to mask your entry if you place huge orders.
Limit order strategy backtest – does it work?
We used to day trade by using limit orders. These strategies are a bit difficult to backtest (sometimes), and we won’t do it in this article.
However, we can briefly explain how you can do it.
Let’s assume you have a trading idea that you want t enter positions straight after the open, for example, within the first 30 minutes. You hypothesize that plenty of stocks get “shaken out” during the first minutes, and the weak hands are filtered out for the more “knowledgeable” players. During the 2000s, this “shakeout” strategy was popular and worked reasonably well.
Whether or not the “shakeout” reasoning is still correct is not part of this article. But for the sake of argument, let’s assume so.
How do you go about backtesting such a strategy with proper trading rules and settings?
The first thing you would need is a proper dataset. The reason why is that you face two problems:
- Fake prints. Many stocks show a low in the first minutes, which is incorrect. One of the reasons is trades that are reported from the day before (or even earlier).
- Low volume. The low might be correct, but the stock is thinly traded, thus, you would likely get a partial fill or no fill at all.
Your backtest will most likely overrate the statistics and trading performance because of the two problems mentioned above and turn the strategy more or less useless when you start live trading. The problem is you are more likely to get the losers and not the winners!
This is not theory, we have seen traders ourselves being super optimists after backtesting only to get completely demotivated when the strategy shows losses instead of wins. Even worse, we have also been fooled by such promising backtests.
Can you remove the bad data in a backtest?
Yes, to a certain degree.
First, you can only use data between the open and the close. The open and close are mostly correct.
Second, perhaps the best option is to subscribe to a data provider that has good data. We recommend Norgate. They only provide daily data (not intraday) but our experience is that this is the best data, but it comes at a bit steeper price than most other providers. But if it can save you from unnecessary losses, we believe it’s worth the price.
List of trading strategies
We have written over 1000 articles on this blog since we started in 2012. Many articles contain specific trading rules that can be backtested for profitability and performance metrics.
The Amibroker code for the backtested positional trading strategy is included in the package.
The trading rules are compiled into a package where you can purchase all of them (recommended) or just a few of your choice. We have hundreds of trading ideas in the compilation.
The strategies are taken from our source of what are the different types of trading strategies. The strategies are an excellent resource to help you get some trading ideas.
The strategies also come with logic in plain English (plain English is for Python traders).
For a list of the strategies we have made please click on the green banner:
These strategies must not be misunderstood for the premium strategies that we charge a fee for:
FAQ limit order strategy
We end the article with a few frequently asked questions about the limit order strategy:
What is a limit order?
A limit order is used in trading to buy or sell a security at a specific price or better. Limit orders are typically used to protect profits and limit losses.
What is the benefit of using limit orders?
The main benefit of using limit orders is that traders can set a specific price point and guarantee that their order is executed at that price or better. This eliminates the risk of placing a market order and having the trade filled at an unfavorable price. It also helps to protect against slippage, which is the difference between the expected price of a trade and the price at which it is filled.
Is a limit order a good idea?
It depends on your time frame and the liquidity of the stock you are looking at. Are you planning to own a stock for many years and the stock is liquid, you are probably better off buying at the market and forgetting about it.
Are you a swing or short-term trader, you would probably use a limit order not to get too much slippage.
How do you profit from a limit order?
It’s difficult to measure the profits directly from a limit order – it’s probably an indirect saving. The main benefit is potentially less slippage, but it comes at a cost: If the limit order is too low you won’t get filled.
What is the disadvantage of a limit order strategy?
The main disadvantage is that you might not get filled. Unlike a market order, you are not guaranteed to get a fill.
What types of limit orders are there?
There are two types of limit orders: buy limit orders and sell limit orders. A buy limit order is an order to buy a security at or below a specified price, while a sell limit order is an order to sell a security at or above a specified price.
How do limit orders work?
Limit orders are placed with a broker, who will then attempt to fill the order at the specified price. If the price of the security moves in the opposite direction of the order, the order will not be filled. If the price of the security moves in the direction of the order, the order will be filled at the specified price or better.
What is a limit order strategy?
A limit order strategy is a trading strategy that uses limit orders to buy and sell securities. This strategy is typically used to protect profits and limit losses by setting predetermined entry and exit points. The goal of a limit order strategy is to take advantage of specific price points in the market while minimizing risk.