Channels ▼


Algorithmic Trading

What Makes Trading Algorithms Possible?

Trading algorithms have been made possible by the open availability of electronic APIs, to enable connectivity to exchanges and other electronic trading venues. In equities and some futures trading, exchanges provide a centralized venue to buy and sell stocks and futures. Foreign exchange is similar, but there are many more independent electronic venues, rather than a centralized exchange (this is called an over-the- counter, or OTC, market). Streaming data can be received by connecting directly to the trading venue or through an information provider, such as Reuters. The streaming data represents the changing prices and availability of instruments on the venue's order book. It is also possible to send orders into the venue's order book, thus enabling buying and selling at an available price, or registering a bid or offer at a certain limit.

Giving an algorithm access to these multiple APIs enables it to watch the changing market data and place orders when certain desirable levels are met.

What Do Trading Algorithms Do?

There are a variety of algorithms in common use within the financial industry. However, the battle for supremacy in algorithmic trading exists in the creation of new and bespoke algorithms. The aim is to develop the most profitable algorithm at the expense of all others.

The two main parts of a trading algorithm are sequences of steps determining when to trade and how to trade.

Determining when to trade is a decision that revolves around watching the changing market data and detecting opportunities within the market. This is the analytic part of the strategy. As an example, consider a "pairs trading" strategy (see Figure 1). This strategy examines pairs of instruments that are known to be statistically correlated. For example, consider Shell and Exxon. Both are oil stocks and so, to a large degree, are likely to move together. Knowledge of this trend creates an opportunity for profit, as on the occasions when these stocks break correlation for an instant, the trader may buy one and sell the other at a premium. This is what a pairs-trading strategy is all about. Here, the algorithm involves monitoring for any changes in the price of either instrument and then recalculating various analytics to detect a break in correlation. This can be calculated, for example, by identifying that the spread between the two instruments has exceeded certain standard deviations (so-called "Bollinger Bands").

[Click image to view at full size]

Figure 1: Pairs trading strategy (statistical arbitrage).

Determining how to trade centers on placing and managing orders in the market. As an example, consider a "wave-trading" strategy, which breaks up a large order into smaller orders and places them sequentially into the market over time. The benefit of this is that large orders can get a poor price and can also have a major impact in moving the market overall. Smaller orders are more likely to flow under the market's radar, and subsequently have fewer consequences at a higher level. The wave-trading algorithm simply calculates a number of smaller slices based on trader input and then at prescribed intervals, it places the next wave into the market, barely creating a ripple.

Related Reading

More Insights

Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.