The right forex algorithmic trading strategies are critical for successful automated trading. Automating your cfd and forex trading can save you time but it can be hard to know where to begin. This guide will help start your algo trading journey.
Forex algorithmic trading strategies can save you time and deliver consistency when trading. With technology today, automated trading systems are now easier to create and manage. Complex programs once relegated to hedge funds and investment banks can now be deployed by retail investors.
Many traders leverage various algorithms quite successfully. The tough part is figuring out where to start, and there are plenty of concepts to sift through.
This article is intended to help you answer those questions.
In this article we’ll cover the following topics:
People often assume that algorithms require a degree in data science, machine learning, or years of computer programming.
While those skills will help, algorithms range from simple to highly complex. And you don’t need to be a quant to understand them.
Here’s a great example.
Forex traders often look for increased volatility in the British Pound Sterling (GBP) or Euro (EUD) during the open of the London trading session.
Let’s say one trader finds that through historical backtests that 60% of the time the Euro closes higher against the U.S. Dollar (USD) than it opened. That trader could develop a program that buys the EUD/USD currency pair at the open of the London session and sells at the close.
From there, a trader can choose to either program time alerts so he or she can manually place the trade or set up an automated trading system that performs the transactions for you.
These days, everyone from retail traders to large hedge funds uses algorithmic trading strategies. In fact, that’s largely how funds that track market indexes operate.
Any Forex trading strategy needs to consider the following six elements:
Forex traders, whether day trading, swing trading, or investing need to size their risk correctly to ensure that no one trade or losing streak puts them out of business.
Risk is a measure of capital put at stake against the possible losses and rewards. If I put up $100 of my $1,000 account into a trade, I’m risking 10% of my total capital. This is the most critical factor in determining the success of a trading system.
Any trading strategy has a probability of success and failure and a chance at a certain profit or loss. The interaction between risk and reward with the probability of success and loss creates variance.
You can think of variance as the volatility in outcomes if you repeated the same trade over and over.
For example, if I flip a coin 100 times and I make $1 for every time it comes up heads and lose $1 for each tails, I know that over time, I will break even on average. If you plotted the results of this experiment, you would see a line that bounces around $0. The chances that I hit 3 heads in a row are slim whereas 10 times in a row is nearly impossible.
Whether you trade the stock market or Forex market, managing your risk is what keeps you in the game over the long run.
Here’s an easy way to think about risk.
Let’s say I present you with a trade that has a 95% chance of winning. If you win, you get $1,000,000.
Now let’s assume that if you lose you have to pay me $1,000,000,000,000,000.
95% doesn’t look so good anymore.
Even 99.999% probably isn’t worth it.
And one thing most
It doesn’t matter how much historical data you use, how much backtesting you perform. There is ALWAYS a chance for human error no matter what your results say.
In Forex, traders employ a concept known as leverage. Leverage allows you to control multiples of your money for a trade. It goes hand in hand with risk management.
A leverage of 100x on a trade of $1,000 means you control $100,000 of buying power.
The type of product you trade also has a direct impact on the amount of leverage and risk. Contract for difference (CFD) products allow traders with small accounts to gain significant exposure to price movements in currency pairs. In the U.S., CFD products aren’t available, so traders can use currency futures to gain leverage.
What’s important to remember is that leverage uses borrowed funds. While you can make big gains, you can lose a lot as well. And since it’s borrowed funds, you could end up owing money in some cases.
Tunnel vision often plagues newer traders. They fail to look beyond the chart and technical indicators right in front of them. It creates a myopic view that prevents them from truly analyzing the market.
Comprehensive trading systems look at the current time frame – the time measure for each bar or period on a chart – as well as several higher and lower.
For example. If I create a strategy that uses an hourly chart, it behooves me to analyze the daily time frame for the broader trend as well as the 30-minute time frame for short-term momentum.
Additionally, most currency trading works better when analyzed in the context of the overall market.
Imagine buying the Turkish Lira against the EUR because of strong technical indicators when every other major currency points to weakness in the Lira. Especially with intraday price action on smaller time frames, you can find your trades quickly hitting stop-loss orders if you don’t look at the bigger picture.
Not all trading platforms are compatible with algorithmic trading systems and automation. Check to make sure that both your broker and platform support algorithmic trading.
When in doubt, most algorithmic traders use Metatrader 4 (MT4) which has become the industry standard platform for forex trading. MetaTrader 4 uses Expert Advisors (EAs) and robot programs so you can automate your trading.
Other options to automate your trading include social trading and copy trading. While these do not use algorithms, they can automate your trading by allowing you to copy other successful traders.
Everyone gets into Forex trading for different reasons. Some of us want to enhance our retirement. Others want to generate wealth. Whatever your reason, it’s important to list your goals.
Goals follow a specific format – to achieve X results by Y time/date.
For example, I want to make $500 by June or I need to complete 30 trades this month.
Goals don’t need to be based on earnings. But with a trading algorithm, you should have regular milestones where you review the performance of your system.
Lastly, it’s important to consider the amount of time you can dedicate to the project. If you work a full-time job, trying to manage a day trading system can be difficult if not impossible.
You also need to consider the amount of time and effort it takes to program and evaluate your algorithm. If you’re not proficient in java, python, or other programming languages necessary to run your system, you’ll need to engage an outside programmer. Even if you can manage all the programming and backtesting yourself, it requires a significant amount of time and effort to create, backtest, implement, and then monitor your trading system.
To get you started on your journey, here are five common strategies used to create Forex algorithms.
Economic events, as well as political votes, often influence foreign exchange markets. The more important the event, the higher the odds of significant price movements.
Think back to the historic Brexit vote and the huge price swings in the GBP afterwards.
Next time you get a chance, look at the intraday price movement around an employment report and the corresponding currency pairs.
News-based algorithmic trading strategies generate trade signals based on real-time information. These trades are typically short in duration, lasting seconds to minutes.
With short-term trading strategies, it’s important to consider slippage. Slippage is the amount of profits you give up due to the timing difference between the signal and the execution. With trades that rely on fast entries and exits, slippage becomes more important compared to swing trades which may last days.
Trend-based strategies are some of the most common and easiest to implement. These strategies attempt to follow along with trends or identify when they reverse.
Moving averages are commonly used for trend technical analysis.
For example, when the 200-period simple moving average is rising, a trend following system might go long or buy the currency pair. When the moving average turns downward, the system could take it as a signal to enter sell orders.
Many currency pairs and stocks often return to historical averages after significant price movements. Mean reversion strategies attempt to buy at extreme selloffs and sell at extreme runs with the expectation that prices will return to the average.
The problem is that extreme prices might occur for a reason and reset the averages over time.
For example, after the Brexit vote, the GBP sold off against the USD and stayed at lower levels for years. Financial markets can and do change over time. That’s why risk management is critical to being successful with mean reversion strategies.
This isn’t a strategy for novices. High-frequency trading attempts to make small amounts of profit over thousands if not hundreds of thousands of trades.
In fact, trades can last a fraction of a second, trying to exploit inefficiencies in the system.
Many of these types of strategies are limited to hedge funds or investment banks. Being successful in this category often requires significant capital investment.
While these strategies aren’t often available for the retail crowd, they do benefit from them. HFT strategies often add liquidity, albeit for a short period of time as well as tighten spreads.
Imagine finding one Forex broker offering to sell you the EUR against the USD for 0.90. At the same time, you notice another broker offering to buy that same pair for 0.95.
You go in and buy from the first broker and then immediately sell it to the second broker making a profit of 0.05.
These trading opportunities come in various forms across all sorts of markets. They’re often exploited by high-frequency trading systems.
Finding price anomalies and disparities between markets have gotten more difficult given the pace and availability of technology as well as the cost of real-time market data. That’s why most retail traders tend to shy away from this option.
There are likely as many trading strategies out there as there are stars in the sky. Finding the one that works for you can be a challenge. If you’re not a programmer it can be even more difficult.
But here are some basic tips to help you find one that works for you.
Automating a Forex trading system opens up a world of possibilities. For those who struggle with discretionary trading and controlling emotions, it’s a great way to mitigate these issues.
Even if you never plan to implement an automated strategy, understanding how they function can help you navigate the market.
Justin Grossbard has been investing for the past 20 years and writing for the past 10. He co-founded Compare Forex Brokers in 2014 after working with the foreign exchange trading industry for several years. He also founded a number of FinTech and digital startups including Innovate Online and SMS Comparison. Justin holds a Masters Degree and an Honours in Commerce from Monash University. He and his wife Paula live in Melbourne, Australia with his son and Siberian cat. In his spare time, he watches Australian Rules Football and invests on global markets.