Powerful Ordertypes for Algorithmic Trading

Have you already found your suitable algo trading strategy? Then you should definitely take a look at the most important order types to improve trading for you!

 

With a well thought-out algo trading strategy, it is possible for every trader to carry out automated transactions and thus quickly take advantage of very good opportunities in the market. To increase your chances on the markets and avoid traps at the same time, a solid basic understanding of order types and their additions is essential. Luckily for you, we have summarised the most important order types for your trading algorithm in an understandable way. Stay tuned, it’s worth it!

In this article you will find all the important order types and order add-ons you need to know for your trading algorithm. We also show you the advantages and disadvantages of different order types and the strategies you can use them for.

The most important order types at a glance

Key Takeaways

  • Order types and additions offer you the possibility to protect yourself against large losses
 
  • We recommend the most popular order of professional traders: the Stop Loss Order
 
  • The order add-on Stop is very well suited as a hedging instrument if you follow a trend-following or momentum strategy
 
  • For bets on sideways moving markets we recommend the OCO order add-on
 
  • Use order validity to be prepared for unpleasant surprises on the next trading day 

What order types are available for algo trading?

In addition to buy and sell orders, the algo trading area offers advanced order types that allow you to place combinations of automated buy and sell orders without having to keep an eye on the market. Especially in very volatile markets, advanced order types and additions are indispensable in order not to make bigger losses. 

 

When placing an order on the stock exchange, not only the type of transaction, buy or sell, and the type of security to be traded are determined, but also the type of order to be executed. We have therefore summarised the basic order types for you below:

Market Order

With a market order, your order is executed at the current price on the stock exchange. There is a distinction between a buy order, which is used to buy securities, and a sell order, which is used to sell securities.

 

A transaction with a market order is usually very fast and is therefore not a bad choice even in illiquid markets. Especially if you want to get into the market quickly or get out just as quickly, a market order is absolutely reliable. For example, if you create a market order to buy 10 Tesla shares, the purchase will be executed on the stock exchange at the current price (status 28.09.2020, 10:12 a.m.: 360.00€). The market order is therefore also called “unlimited” or “best” on some trading places.

 

If, on the other hand, you want to wait for the perfect time to enter or exit the market, the market order is not very suitable. Prices on the market also fluctuate considerably during the day. It can happen that the price rises or falls by a few points in a few seconds. If you now want to buy 10 Tesla shares, but the price unexpectedly rises to 365.00€ a few seconds before, you are probably paying too much for your shares. On the other hand, if you have 10 Tesla shares and want to sell them at the highest possible price, the price may fall to €355.00 in a few seconds. This could mean that you will receive too little profit for your share sales or even lose money.

 

To reduce the risk of bad timing, there are other useful orders on the stock exchange.

Limit Order

With a limit order you can protect yourself in volatile markets from being exposed to unexpected price fluctuations and thereby inadvertently paying too much for your shares or getting too little for your shares.

 

With a limit order, the transaction will be executed at a price you set in advance or better. For example, if you place a buy order with a limit of €365.00 for your Tesla shares, the order will be executed when the share price is quoted at €365.00 or less. If the share price is above that, the order will not be executed.

 

If you place a sell order with a limit of 355.00€, the order will only be executed if the price of the Tesla share is not below 355.00€, i.e. 355.00€ or higher.

 

In particularly illiquid markets you can therefore protect yourself with a limit order from paying too much for buying your shares or getting too little for selling them.

 

If the price you set is not reached during the term of your order, your order will be deleted from the order book of the marketplace. The order must then be placed again. You should therefore make sure that your limit is not set too high or too low. Otherwise you might wait for an eternity for the ‘perfect’ moment and in the end you might not make a profit or even miss your chance.

Stop Order

A distinction is made between the two order add-ons stop-loss and stop-buy order.

The stop-loss order, which can be set when selling securities, is used to protect you from losses. Suppose you own 10 Tesla shares that you bought at a price of € 365.00 and you want to hold them until the price falls below a certain limit. This lower limit is the so-called stop price. If the price of the share reaches the stop price, a market order (unlimited) is placed and thus executed as quickly as possible. However, this does not mean that the selling price is guaranteed. It will only be sold at the price at which the next trading transaction takes place. The actual selling price can therefore also be below the stop price. If the price rises again after reaching the stop price, the market order can be executed. The stop price therefore only acts as a trigger for the placement of a market order.

The stop-buy order, on the other hand, is set when securities are purchased. Contrary to what the name suggests, a market order to buy a security is placed when the stop price you have previously set is reached or exceeded. The stop-buy order is therefore often referred to as a “start-buy order”. However, it is important to understand that the market order can be executed after the stop price has been reached, even if the price is then below the limit you set.

An advanced alternative with additional protection against unexpected price movements is the stop-buy limit order. Here a limited buy order is placed after the stop price has been reached or exceeded. You can set the limit below the current price, between the current price and the stop price or above the stop price. In this way, you either benefit from a small downward correction after reaching the stop price, or you can make sure that the demand for your stock continues above the stop price.

In addition, the stop-loss limit order can prevent you from selling your securities at too low a price. When the stop price is reached, a limited sell order is placed. Your limit can be above the current price, between the current price and the stop price or even below the stop price. If the market falls too sharply in a short period of time, you make sure that you still get a reasonable price for your securities.

As you can see, the stop add-on sets a buy or sell order that will remain unexecuted until the stop price you set is reached. A stop order is therefore only converted into another type of order, normally an unlimited market order.

The Stop order add-on is of particular interest to you if you are following a trend-following or momentum strategy. Thanks to the Stop addition, it is no longer necessary for you to constantly monitor your securities and to constantly re-estimate the ‘perfect’ time. Especially in sideways moving markets, you can automatically follow an emerging trend and profit quickly from rising prices

Trailing Order

A dynamic variant to the above-mentioned limit and stop order is the so-called trailing order. The trailing addition ensures that the price at which your order is to be executed does not exceed a previously set distance from the current price. The execution price therefore follows the current price at the specified distance. If the price rises, the execution price of your order increases. If the price falls, the execution price of your order also falls. The distance can be set either in absolute terms, for example 10€, or in relative terms, for example 10%.

 

A popular choice for traders is therefore the combination of a trailing and a stop-loss order. A so-called trailing stop-loss order automatically secures a certain part of your price gain.

 

Let’s assume you have bought your 10 Tesla shares at a price of 360.00€ on the stock exchange. The price now increases to 365.00€. To secure your price gain of 5€ per share, you can now place a Trailing-Stop-Loss Order with a gap of 5€ to the current price. Your current execution price for the stop-loss order is €360.00. If the price of the Tesla share rises to €375.00, the execution price is €370.00. If the share price falls to €370.00 an unlimited market order will be executed. Your Tesla shares will be sold and you will still have a profit of €10 per share.

 

Combinations such as Trailing-Stop-Loss-Limit or an addition for Stop-Buy Orders, with or without limit, are also possible. Have fun! 

 

Further order add-ons

In addition to the order types you are now familiar with, there are also other useful order add-ons with which you can further expand your algo trading strategies. We have summarised the most important and best-known ones for you here: 

Market-On-Open & Market-On-Close

Two further variants of an unlimited market order are the order add-ons Market-On-Open (MOO) and Market-On-Close (MOC).

With a MOO add-on, an unlimited market order is executed at the start of the trading day. The advantage is that this order is then given priority over normal market orders. However, please note that your MOO order was placed by you before the market opened.

With a MOC add-on, an unlimited market order is executed at the end of the trading day. Again, this order will be given priority. Your MOC order must be placed in the right time (often 0.5 – 1 hour before the market closes).

All-Or-Nothing

If you trade several quantities of a security, it can sometimes happen that partial executions are possible. This means that only parts of the securities you have ordered are bought or sold and not the entire number of units.

You can prevent this with an All-Or-Nothing or All-Or-None (AON) order. Either the order is executed with the entire number of units or it remains in the order book until a later date. As you can probably already imagine, your order will then be executed subordinate. The priority for the trading centre is then for all other limited and unlimited orders. You will usually have to have a little patience with this order add-on.

Immediate-Or-Cancel

If, on the other hand, you want to get things done quickly, you can use the Immediate-Or-Cancel (IOC) order. This means that your order will be executed immediately with all or part of the quantity. If there is only a partial execution, the other part of your order will no longer be executed, as the name suggests. So if you are not interested in the exact number of pieces, but rather in the time, the IOC order add-onis a good choice.

Fill-Or-Kill

It can be even more complicated: the so-called Fill-Or-Kill (FOK) order – a combination of an AON and an IOC order. It allows you to immediately execute your entire quantity of a security at the limit you set (Fill). However, if this is not possible on the stock exchange, it expires unconditionally (Kill).

 

So if you want to buy an exact quantity of shares and need them immediately, then the FOK order is the perfect solution. However, you must also be aware that your order will not be executed. So sometimes it is better to buy or sell at least a part of the shares than to miss the whole chance on the market.

One-Cancles-the-Other

Let’s go back to the stop and limit orders. A very popular option among professional traders is the combination with two selling points: One above and another below the current market price. Often both a stop loss order to be executed below the current price and a sell limit order to be executed above the current price are used. If either the stop price or the limit is reached or even exceeded, the other order expires. This means that only one of two orders will ever be executed. This is why this order add-on is also called One-Cancles-the-Other (OCO).

In this way, you are protected twice over: if the price falls during the day, the losses are kept low by the stop-loss order. If, on the other hand, the price rises, the price gains are realised through the sell limit order. This is a dual hedging instrument.

Especially when betting on sideways moving markets, this is an interesting addition that can save you a lot of misery.

Book-Or-Cancel

The last order add-on we would like to present to you is somewhat unusual. With the so-called Book-Or-Cancel (BOC) addition, your order is only placed in the order book if it cannot be executed immediately. This order is used less frequently than the others, but still has its raison d’être: it ensures that sufficient liquidity can be built up in the order book, because this way other traders who wish to acquire a large number of securities can also be served.

 

lemon.markets Algorithm Code
lemon.markets is in open Beta

In our open Beta you are able to test the fully functional API with your strategy, completely without any risk, just using paper money instead. 

Order validity

If the time period in which your order is to be executed is important to you, then pay close attention now: As if the whole thing wasn’t confusing enough, we have summarised four order validities and documented them in a way that you can understand.

Good-For-Day

With Good-For-Day (GFD) your order will only be valid for the current trading day. If the order is not executed on that day, it disappears from the order book and you no longer need to worry about it being executed the next day. Because your order is only valid for the day, this order validity is often subscribed as DAY.

Good-Till-Date

If it is important to you that your order is only to be executed by a certain date, then Good-Till-Date (GTD) is the right choice. This allows you to determine the trading day until which your order should be executed. If it is not executed by then, it simply expires.

Good-Till-Cancelled

If neither GFD nor GTD are suitable for you, Good-Till-Cancelled (GTC) might be interesting. This gives you the option of leaving your order in the order book until it has either been executed or it is deleted from the stock exchange in a period of your choice. As a rule, the validity period for this order is 90 days.

Ultimo

Finally, something easy. With Ultimo you can leave your placed order valid until the end of the month. If it is not executed by then, it simply expires.

Conclusion

On the stock market, the motto is: “Let profits run, limit losses”. With all the turmoil on the markets, it is often possible to lose track of what is happening. Losses are then no longer a rarity and often a painful experience. This is where order types such as stop-loss or trailing stop-loss help to keep your losses low (or even avoid them altogether). 

 

Order types and additions are a confusing topic at the beginning. However, it is worth investing the time to find your way through this jungle. After all, this is about your money.

 

You can combine the order types with add-ons to optimise your algo trading strategy. Professional traders in particular use order add-ons on a daily basis and react more skilfully than their market competitors. You should also not underestimate order validity. Learn to appreciate their advantages and integrate them into your trading algorithm. With a little practice you will quickly reap the benefits.