Forex Algorithmic Trading
Algorithmic trading in the forex market is an automated trading method that uses a computer program to trade currencies based on a predetermined set of rules. The theoretical benefits of using algorithmic trading are the removal of trader emotions, improved market liquidity, and the ability to make trades far more frequently and rapidly than a human trader ever could.
The rules defined in an algorithmic trading program might be based on price, timing, or any other mathematical model.
Algorithmic Trading in Practice
Here’s an example of a potential algorithmic trading program:
- Buy 1 lot of EUR/USD when its 50-day moving average crosses above the 200-day moving average.
- Sell 1 lot of EUR/USD when the 50-day moving average crosses below the 200-day moving average.
These two simple instructions are enough to make an algorithmic trading program. If implemented the computer will monitor price movements and enter buy or sell orders when the conditions defined in the program are met. This will continue without any human intervention until someone turns the computer program off.
Benefits of Algorithmic Trading
There are a number of benefits to algorithmic trading in the forex trading markets:
- Trades are always placed at the best possible price.
- Trade orders are made instantly giving a high chance of execution.
- Trades are placed immediately, avoiding the potential for significant slippage.
- Transaction costs can be reduced.
- Market conditions are constantly monitored.
- Removes trading risks of manual errors during order entry.
- Back testing works well to determine if an algorithmic trading strategy will be profitable.
- Removes the chance of trading mistakes due to psychological and emotional factors.
These days most of the algorithmic trading is done by large institutional investors and falls under the category of high-frequency trading (HFT). This is a method that attempts to capitalize on even small price changes by placing many orders across a number of markets, and based on a large number of decision instructions.
It isn’t just institutions that use algorithmic trading though. It is used by a variety of investors and traders, such as:
- Buy-side firms such as insurance companies, mutual funds, or pension funds often use algorithmic trading to enter large positions when they don’t want to influence the price by making a single large trade.
- Sell-side traders such as arbitrageurs, speculators, and market makers can benefit from algorithmic trading, plus their trades can help add liquidity to the markets.
- Systematic traders such as hedge funds or trend followers find algorithmic trading to be far more efficient when compared with manually trading.
At the end of the day an algorithmic trading system provides a more systematic approach to trading that many consider to be more efficient than trading on instinct or intuition.
Algorithmic Trading Strategies
There are a number of algorithmic trading strategies that use market opportunities to increase or improve the profitability of a trader. Below are some of the common algorithmic trading strategies in use in the forex markets:
Trend-following Strategies
The most common types of algorithmic strategies are those that follow trends in technical indicators such as price levels, breakouts, moving averages, or simple support and resistance levels. These strategies are both easy to implement through algorithmic means, and they tend to be fairly successful when the proper indicators are used. Trades are made based on the occurrence of basic trends, and this is easy to implement programmatically without having to worry about predictive algorithms. One of the most popular trend following strategies uses the 50-day and 200-day moving averages.
Arbitrage Opportunities
Buying in one market at a lower price and selling in another simultaneously in another market at a higher price is a type of trading known as arbitrage. This type of trade offers risk-free profits, but is extremely difficult for a human trader to pull off since arbitrage opportunities might only exists for seconds. However, an algorithm is very good at pulling off this type of strategy since it can place trades immediately, and is also capable of placing hundreds or thousands of trades per minute. This can be a very efficient way to collect risk-free profits.
Index Fund Rebalancing
Every index funds has a defined period of time in which to bring their holdings in-line with whatever benchmark index they are replicating. This offers an arbitrage-like opportunity for algorithmic traders who can capitalize on this rebalancing by targeting the assets that need to be purchased just before the rebalancing period. These types of trades are best executed algorithmically to get the best timing and the best prices.
Mathematical Model-based Strategies
There are a number of mathematical models, such as the delta-neutral trading strategy, that are proven to be effective in trading with multiple positions that offset positive and negative deltas. These deltas are ratios that compare the change in the price of an asset to the corresponding change in price of its derivative, such as a future or option. The goal is to have the overall delta of all the open positions balance out and equal zero. Obviously, this is best done using an algorithm that can easily calculate these values and place multiple orders at the same time.
Trading Range (Mean Reversion)
The mean reversion strategy is based on the concept that high and low prices are temporary, and that the price of any asset will revert back to an average level after a period of time at the extremes. If a trader can identify a range and implement an algorithm based on that then trades will be placed automatically any time the asset breaks out of its normal range.
Volume-weighted Average Price (VWAP)
This strategy is popular with funds that need to acquire a large amount of a particular currency, but they don’t want to impact the price. The algorithm breaks a large order into smaller chunks and then executes those using historic volume data. Ultimately the goal is to execute each order close to the volume-weighted average price. A similar algorithm does the same thing using evenly spaced time frames and is called the time-weighted average price strategy.
Percentage of Volume (POV)
This is another strategy that attempts to fill a larger order in small chunks to keep the average price stable. It will send small chunks of the complete order based on the defined volume and price parameters until the complete order has been filled.
Implementation Shortfall
This strategy seeks to minimize the execution cost of an order by increasing the order volumes when the spread tightens, and decreasing order volumes when the spread is larger. This keeps the cost of order execution low.
Beyond the Usual Trading Algorithms
In addition to the typical algorithms there is a special class of algorithms that look for algorithms already trading and then take the opposite side of that trade. So, the algorithm might identify a large buy order being implemented algorithmically and will then look for ways to fill those orders by buying lower priced currencies and selling them to the algorithm at higher prices. Sometimes these are referred to as high-tech front-running algorithms.
Technical Requirements for Algorithmic Trading
The implementation of a trading algorithm is the final step in creating a forex algorithmic trading strategy. Prior to actually implementing the algorithm thorough back testing should be employed to ensure the probability of profitability. Remember, once you start up an algorithmic trading system it will keep running whether the trades are winning or losing. The challenge then is to translate the imagined strategy into a computerized program that can successfully trade the forex market.
Most individuals aren’t going to create their own forex algorithms for trading, but it is helpful to know how they are made and how they work. In some cases, you might find yourself investing with an algorithmic trader or firm. If you do choose to create your own algorithm here are the requirements:
- Knowledge of computer programming, or the resources to hire a programmer. Some also use pre-made software.
- Access to a trading platform allowing algorithmic trading, like on MT5.
- Access to market data feeds.
- Some way to back test the system before taking it live.
- Availability of accurate historical data for back testing the system.
While it could seem a bit complex and intimidating, if you can learn to program your own algorithmic trading systems that are successful you can make your trading life a lot easier on a day to day basis. Remember though that markets are always changing, and that means you can’t simply release a trading algorithm without checking in on it from time to time. Maintenance is just as important as the creation of the algorithm if you don’t want to open your trading platform and account one day to see that market conditions have changed and your algorithm has blown your account up while you weren’t watching.
Other risks to algorithmic traders include network outages, slippage, and system failures. And the more complex the trading algorithm is the more maintenance it will need.