IBKR Quant Blog



Quant

Back to Basics: Introduction to Algorithmic Trading - Part 1


This is the first in a series of posts in which we will change gears slightly and take a look at some of the fundamentals of algorithmic trading. So far, Robot Wealth has focused on machine learning and quantitative trading research, but I had several conversations recently that motivated me to explore some of the fundamental questions around algorithmic trading. In the next few posts, we will investigate questions such as:

  • What is algorithmic trading?
  • What can algorithmic trading do for me?
  • What are the pre-requisites? What should I think about before getting started?
  • What’s all this fuss about curve fitting and robust optimization? Why should I care?

So without further ado, let’s dive in!

What is Algorithmic Trading?

At its most basic level, algorithmic trading is simply the automated buying and selling of financial instruments including stocks, bonds and futures. It requires a networked connection to an electronic exchange, broker or counterparty. In addition, you need a means of programmatically buying, selling and performing other tasks related to trading, such as monitoring price action and market exposure.
Algorithmic trading is enabled thanks to the rise of electronic exchanges – a relatively recent phenomenon. Once upon a time, financial products were traded in the so-called ‘pit’ inside the exchange building using the ‘open outcry’ method. This consisted of brokers and traders being physically present in the pit and shouting prices at which they were willing to buy and sell. Participants even used hand signals to convey their intentions. This gradually began to give way to telephone trading and eventually to electronic trading. The shift started sometime in the 1980s and continues to this day, however the vast majority of exchanges around the world are now electronic.

Naturally, this evolution changed the dynamics of the trading process. Anecdotally, pit traders could sometimes read each other’s intentions through the physical contact that comes with being in the pit – obviously this is incredibly implausible when market participants trade electronically and can be separated by potentially vast spaces. Stories of life in the pit makes for interesting and often amusing reading. Some curated links:

It is also worth noting that algorithmic trading is not just for exchange-traded markets: over-the-counter (OTC) markets are also traded algorithmically. An OTC market is one where orders are not executed through a central exchange, but rather between two parties. OTC algorithmic trading typically takes place via an Electronic Communication Network (ECN) or dark pool. The former is typically used by market makers to disseminate and match orders with their network of counterparties. The latter is more like a private execution venue where liquidity is provided by the participants of the dark pool, away from the exchange.
Advocates of electronic trading point out the attendant increased market efficiency and reduced opportunity for manipulation. Electronic trading is also typically less expensive and with the advent of cheap Internet, is accessible to anyone with a decent connection. This means that an individual can buy or sell a financial product from their living room.
It must also be pointed out that as electronic trading has taken off, the instance of ‘flash crashes‘– huge spikes in volatility over short periods of time – has also increased. A case can be made that suggests that algorithms exacerbate such a crash because they act much faster than a human can intervene. But on the other hand, exchange operators are finding ways to handle this new environment in safer ways, for example electronic mechanisms to curb extreme volatility, order routing co-ordination between exchanges and re-thinking the role of market makers. Whether it is fair to blame flash crashes on electronic trading is a huge and sometimes contentious topic.

In order to execute trades algorithmically, we use a computer program connected to the exchange (either directly or via a broker) that executes our desired trading behavior on our behalf. Such a program or algorithm is simply a set of detailed instructions that a computer understands. A trivial example might go something like “read some price data, calculate its mean and standard deviation, and then if the most recent value of the price data is above its average and the standard deviation is less than some threshold, send a buy order to market.” Of course most trading algorithms are much more complex, but you get the idea.
The simple algorithm described above had some of the common aspects of an algorithmic trading system:

  • A method to acquire data (“read some price data”), noting that this in itself could be quite a complex standalone algorithm and requires connection to a source of market data, usually in real time.
  • Some analysis of that data (“calculate its mean and standard deviation”).
  • A means of checking if some condition has been fulfilled based on the previous analysis (“if the most recent price is above its mean and the standard deviation is less than some threshold”).
  • Execution of the trading logic, which again can be quite a complex standalone algorithm requiring a means of communicating with a broker or exchange, managing that communication link and keeping track of orders and fills.

Other common components of such systems include:

  • Risk management modules, for example position sizing calculations, exposure tracking and adjustment, and tools to track a system’s performance and behavior.
  • Portfolio management tools, which are somewhat related to the above.
  • Data handling and storage.
  • Post-trade reconciliation and analysis.

Stay tuned for in-depth info on why people care about Algorithmic Trading.  In the next post, Kris will also discuss 3 different types of algo trading:

  • Technical Analysis
  • Quantitative Trading
  • High Frequency Trading

 

Learn more about Robot Wealth here: https://robotwealth.com/

This article is from Robot Wealth and is being posted with Robot Wealth’s permission. The views expressed in this article are solely those of the author and/or Robot Wealth and IB is not endorsing or recommending any investment or trading discussed in the article. This material is for information only and is not and should not be construed as an offer to sell or the solicitation of an offer to buy any security. To the extent that this material discusses general market activity, industry or sector trends or other broad-based economic or political conditions, it should not be construed as research or investment advice. To the extent that it includes references to specific securities, commodities, currencies, or other instruments, those references do not constitute a recommendation by IB to buy, sell or hold such security. This material does not and is not intended to take into account the particular financial conditions, investment objectives or requirements of individual customers. Before acting on this material, you should consider whether it is suitable for your particular circumstances and, as necessary, seek professional advice.


17779




Disclosures

We appreciate your feedback. If you have any questions or comments about IBKR Quant Blog please contact ibkrquant@ibkr.com.

The material (including articles and commentary) provided on IBKR Quant Blog is offered for informational purposes only. The posted material is NOT a recommendation by Interactive Brokers (IB) that you or your clients should contract for the services of or invest with any of the independent advisors or hedge funds or others who may post on IBKR Quant Blog or invest with any advisors or hedge funds. The advisors, hedge funds and other analysts who may post on IBKR Quant Blog are independent of IB and IB does not make any representations or warranties concerning the past or future performance of these advisors, hedge funds and others or the accuracy of the information they provide. Interactive Brokers does not conduct a "suitability review" to make sure the trading of any advisor or hedge fund or other party is suitable for you.

Securities or other financial instruments mentioned in the material posted are not suitable for all investors. The material posted does not take into account your particular investment objectives, financial situations or needs and is not intended as a recommendation to you of any particular securities, financial instruments or strategies. Before making any investment or trade, you should consider whether it is suitable for your particular circumstances and, as necessary, seek professional advice. Past performance is no guarantee of future results.

Any information provided by third parties has been obtained from sources believed to be reliable and accurate; however, IB does not warrant its accuracy and assumes no responsibility for any errors or omissions.

Any information posted by employees of IB or an affiliated company is based upon information that is believed to be reliable. However, neither IB nor its affiliates warrant its completeness, accuracy or adequacy. IB does not make any representations or warranties concerning the past or future performance of any financial instrument. By posting material on IB Quant Blog, IB is not representing that any particular financial instrument or trading strategy is appropriate for you.