How APIs Have Opened Trading from Big Brokerages to Individual Traders

While we typically associate API trading with big brokerages or hedge funds running high-frequency arbitrage strategies, in reality, it's a broader market with many more opportunities for entry than most people think. While the space has been primarily filled by institutional traders in the past, recent technological advancements have made API trading available to the average individual trader. Yet many of these traders still choose to trade manually, possibly because API trading is still widely considered to be only for institutions. To fully understand why it was primarily dominated by institutions and why this dynamic has changed let's jump back to the early days of trading when exchange floors were decked with traders in brightly-colored jackets communicating orders by open outcry.

API trading involves executing trades via a broker's server, and the trades are generally placed by an algorithm. Algorithmic trading can be traced back to the 1970's on the floor of the NYSE when the Designated Order Turnaround (DOT) system was introduced to route customers' orders directly to a specialist on the trading floor, bypassing brokers. When a trader submitted an order for a trade, the order was delivered directly to the specialist's screen, which opened the door for computerized trading. Before long, institutions built room-sized computers to monitor price quotes and place orders when a certain price was hit. Once trading became more efficient, prices became tighter and traders discovered spread arbitrage opportunities, in which they would place an order to sell above the market price as well as an order to buy below the market price, and profit off of the difference. Later, in 2001, stocks started to be quoted in decimals instead of fractions of a dollar, allowing the minimum spread to tighten to .01 from .0625 (the lowest possible fractional quote was previously 1/16) massively increasing liquidity. Now with ultra-low spreads and even more liquidity, traders discovered they could make large profits if they got their orders filled faster than their competition, so they started using computer algorithms to trade because they were simply faster than any human trader and thereby increased the chance of beating the competition in the execution race. Now able to trade at previously unheard of speeds and profit off of these ultra-tight spreads, high-frequency trading was born.

Because algo trading led to the birth of high frequency trading these two are oftentimes considered one in the same, however, they are quite different. An algorithm (or algo) is simply a computer program that uses math to analyze incoming data and make decisions according to the way the user has programmed it. High-frequency trading requires using algo trading to beat all other traders to the punch in order to successfully turn a market inefficiency into a profit. High-frequency trades typically have a duration of less than a second. High-frequency trading at the institutional level often involves an entire team of professionals (such as computer programmers, quants, traders, etc) and requires expensive equipment. Algo trading does not require a dedicated team, expensive software, and hardware, or the fastest system in order to be successful. Algo trading in its purest form is simply programming a computer to place trades when certain parameters are met. Many algorithms trade on hourly or even daily timeframes and are managed by an individual trading from their home.

Algo Trading as an Individual, Not an Institution

As algo trading has permeated the retail trading marketplace, there are many instances where an individual can piggy-back off of existing technology designed for institutional traders, however, there are some instances where this is not the best fit. While all traders need access to market data and reliable execution, Electronic crossing networks (ECNs) are one area where one size does not necessarily fit all.

Why ECNs are best for Institutions

All traders need counterparties to sell their buy orders or buy their sell orders. An entity that provides pricing is known as a liquidity prover (LP). ECNs provide liquidity to traders in a decentralized marketplace where a major exchange does not exist, such as FX. Both individual traders and institutions such as banks or hedge funds participate in an ECN as both price makers (LPs) and price takers, meaning they have the ability to quote a price or trade at the price someone else has quoted. An LP may provide the same quote for 'X' price at 'Y' volume across multiple ECNs to have a better chance of having their price taken, as this is how they make a profit. However, a high-frequency trader then has the ability to take advantage of this quote being cross-posted by taking the same trade on price 'X' and volume 'Y' on multiple venues before the LP realizes it and updates the quote.

Where anyone can both make and take prices, the biggest and fastest traders have the upper hand. In this case, if another trader using a non-high frequency system has clicked this price but the price is no longer available due to the HFT's order taking it, then the trader's order is rejected or filled at a worse price. ECNs serve an important purpose and provide liquidity to otherwise illiquid markets and are well-suited for institutional traders and HFTs, but for this reason may not be the best choice for individuals.

When Having a Broker is Best

By connecting LPs through a direct feed rather than through an ECN, a broker can provide protection to its traders. LPs give prices directly to the broker rather than to all participants of an ECN allowing the LPs to be price makers only, which prevents the LPs from having the prices they are offering from being taken by another LP. This allows them to price competitively without the risk of another LP wiping out their liquidity, as only the broker's traders can take their prices. This creates an environment in which the individual trader benefits from low prices and LPs are not at risk of being picked off. FXCM, a leading FX and CFD broker, fill over 89% of retail traders' trades at the price clicked or a better price. When choosing a broker, execution should be one of the first things you consider.

Algo Trading Technology

There are a few things that are necessary to trade any market: price data, connection to a trading venue, and some counterparty to fill your trades. Algo trading adds two obvious but important additional requirements: an algorithm, and somewhere to host it. There are many different ways this combination can be achieved. For institutional traders, a connection to a pricing feed can be purchased (usually for upwards of $10,000 per instrument per month*source) and a dedicated server or custom-designed system. For the individual, this kind of initial investment may not be realistic. A broker is able to create a scale economy by providing a platform and live prices to a large user base, substantially reducing the cost an individual would pay if they were to acquire several data feeds and create and operate a custom platform on their own. Brokers provide live prices, a custom platform to enter and manage trades and offer order execution either by their own inventory or by a pool of banks/hedge funds. Traders have many choices for brokers of every asset class allowing for participation in the markets without the need for expensive professional equipment.

APIs

Both institutions and individuals use APIs because of their flexibility—they are highly scalable and customizable. The API, or application programming interface, receives requests and sends responses which allow programs on different servers to communicate. Using an API, a trader can connect their account to their broker's execution engine without the use of a specific graphic user interface (GUI), allowing for ultimate customization. There are many different kinds of APIs, each providing different features depending on the programming language a trader is most comfortable with. For example the FIX APITrack this API is standard among traders who need speed, generally allowing up to 300 price updates per second. For a trader that is not as speed-sensitive but does need the flexibility of using a particular programming language, the REST APITrack this API is web-based and is compatible with any language supporting standard HTTP calls. Some brokers may offer more specific or specialized APIs to fulfill their traders' needs. FXCM offers the JAVA API as Java is the programming language of choice for many algo traders, as well as the ForexConnect API which can be used on its own or as a bridge to connect an FXCM account to a third-party platform.

Platforms

For traders looking for a user interface or specialized features, software providers color the internet with countless options for algo trading platforms.

  • FXCM Trading Station is a solution for traders looking to employ ready-to-trade algos on their trading account with a few clicks. There are several sample algos available for use on the platform and many more in FXCM's app store. Trading Station is an all-in-one platform including a backtester and optimizer allowing a trader to contain all their work within one platform.
  • Zorro Trader is an open-source platform that is compatible with many different brokers. Zorro is coded in Lite C and the company provides a course to teach any non-coder how to program a strategy in one week's time.
  • QuantConnect provides a comprehensive IDE and is built on the Lean Algorithmic Trading Engine, an open-source cloud-based trading platform designed in C#. QuantConnect not only provides a design-environment it also connects some of the most sophisticated algorithmic traders in the open-source community together.

How to Get Started

Any trader, institutional or individual, that's eager to upgrade their trading system or just to test out this advanced technology can get connected with just a few steps. To get started algo trading, first, decide whether you will be creating your own trading algo or using an existing system (like the ones for FXCM Trading Station). If you will be coding your own system, an easy way to get started is to create an FXCM demo account and generate a token which will be used to connect to the REST API. Then, read over the documentation or watch the tutorials and start pulling data, placing orders and backtesting your strategy. Once satisfied with your backtest results, fund your account and activate your strategy. Congratulations—you are now an algo trader.

References

  1. Designated Order Turnaround - DOT (SuperDOT)
    https://www.investopedia.com/terms/d/dot.asp
  2. The Rise Of Computerized High Frequency Trading: Use and Controversy
    https://scholarship.law.duke.edu/cgi/viewcontent.cgi?article=1211&context=dltr

Be sure to read the next Financial article: Daily API RoundUp: Google Sheets, ConfigCat, Ask Kodiak, Dispatch Labs

 

Comments (0)