LevSelector.com New York
home > Algorithmic Trading

Algorithmic Trading
On This Page Other Pages

- intro
- terminology
- books
- high_frequency_data_analysis
- programming_languages
- tick_data
- low_latency
- misc_resources

- xx

Intro ------------------------------

Algorithmic trading (also known as Black-box trading) - computer-guided trading, where a program with direct market access can monitor the market and order trades when certain conditions are met. As of this writing (2009) probably ~40% of all trades are done this way. The companies run by quants using algorithmic trading produce higher returns than conventional companies. At least during more or less stable times.

As computers eventually has beaten people in chess, it is expected that the same will happen in investing.

Algorithmic trading is usually performed on a relatively short-term basis (from thousandths of a second - to seconds, minutes, hours, days). So the Artificial Intelligence (AI) of those algorithms doesn't compete (yet) with Warren Buffett (long-term investing based on choosing good companies/teams/culture).


Direct Market Access (DMA) today is provided by many brokers, thus making Algorithmic Trading possible to even small investors. If you set up a personal account with a service like Interactivebrokers, and run a script on your own server to communicate via their API to monitor the prices and order trades - you can be in business. If, of course, your algorithms are profitable (statistically).

The benefits of algorithmic trading:

There are many kinds of algorithms, tactics and strategies of algorithmic trading.

Some relevant terminology:



Important 2 books:

More good books:





High Frequency Data Analysis


For historical backtesting one need to store tick data. It is a time series data. So using standard SQL database may be not the best solution. There are many approaches and things to pay attention to. Usually for processing people use arrays in memory (C, C++, J, OCaml). For data storage people use flat files, SQL databases, linea database, etc. You can google for: how to present tick data in the database
Here is excellent discussion:


Programming languages - Functional or Imperative ?

Algorithmic trading (and modeling/backtesting) can be implemented in many different programming languages. See for example:

Generally FP (Functional Programming) Languages are very good for fast prototyping, although they are generally slower. But, again, this is not always the case - for example, OCaml works really fast. FPLs are also easier to parallelize (to run on several computers in parallel).

For some projects you can use combinations of languages. For some tasks selecting a language is just a matter of personal preference. For others

Here are some languages to choose from:

Tick Data

Formal definition of a "tick" is a "minimum change in price a security". For stocks it may be as little as one cent, for US Treasuries - 1/32 of a point, or 31.25 cents. For futures it may be different depending on the contract. The tick size is determined by the exchange. Different products may have different tick sizes.

When people talk about "Tick Data" - they usually mean any type of time series data which includes both volume and price for every point. Additional info may include time (for asynchronous time series), bid/ask, partial Level 2 information (information not only for the best bid/ask, but for several others), etc. Depending on the feed, you can get more or less data. Also you can get absolute values - or only differences (this sometimes is useful to "compress" the data flow).

Sometimes people use the term "Market Data". It is similar. Market data feed may contain more information (for example: Ticker Symbol, Bid, Ask, Bid size, Ask size, Last sale (price), Last size, Quote time, Trade time, Exchange, Volume). The feed may be an aggregation of several feeds.

Tick data can be very big (it is not uncommon to handle terrabytes of data for analysis).

To receive high-frequency data in real time you may need special hardware, because regular ethernet cable and regular hard drive may be not fast enough to handle the traffic. So you may need to parallelize your systems.

For many applications when you don't need fine granularity, you can decrease the amount of data 100 times (and more) by using data presented on a "per minute" basis (or even "per day"). People refer to this data as "bars" or "candlesticks".

Low Latency

Low Latency Trading - done electronically using network connections to exchanges and ECNs (Electronic Communication Networks). ~ 60-70% of the NYSE volume is done this way. Today with algorithmic trading even a millisecond improvement in latency gives a competitive advantage.

Causes of latency:

Measuring latency

Who is affected by latency:

Methods to reduce latency:

Misc Resources

Some articles on short-term effects of trades:

More misc. resources: