Machine Learning Algorithms in Forex Trading

By Olivier Becquet, CEO of BLACKALGO


What is Machine Learning? And How is it applied in Forex Trading?

When a friend uploads your new group photo on Facebook and the platform suggest you tag yourself, it doesn’t mean Mark Zuckerberg and his team are stalking your online activities, it just means technology has evolved enough to learn of your lifestyle and to use the knowledge to assist you in your daily activities such as turning off you home lights. The type of technology, in this case, is referred to as Machine Learning (ML).

“But Machine Learning is not only limited to technological gadgets we use; in recent years, it has become an essential aspect in the financial sector, and a particular forex market.”

Forex market is very volatile and has grown to be a very competitive exercise. Just like the Brexit vote, and the 2016 US presidential elections, the forex market is unpredictable and tends to be illogical; all this is due to the chaotic nature in which forex data is structured, a characteristic that makes it hard for forex traders to identify market patterns. To solve this problem, forex traders are opting for more sophisticated tools that help them to make decisions that edges them out. Machine Learning is one of the cutting-edge tools employed in the forex market – it works by analyzing huge chunks of data, spotting patterns, and outputting the results in a very simple manner that enables the forex trader to refer to when making a trading decision.

Implementing Machine Learning in Forex trading involves developing algorithms based on historical data (stock price/forex data). These algorithms analyze the data to identify patterns and predict the futures.

 Examples of Machine Learning Algorithms used in Forex Trading

There are a lot of algorithmic tools based on machine learning used in forex trading; some of them are: SVM and Neural Network.


A Support Vector Machine (SVM) is a machine learning language deployed for data classification. The language has largely been accepted because of easiness of its implementation in problems related to data classification. SVMs work by separating data sets with decision boundaries (hyper-planes); and from the hyper-planes, new data can be classified. Applying this concept in Forex trading, SVM is used to predict or determine whether a market trend is either bullish and bearish. This is achieved by plotting hyper-planes between highs and lows of a trend – a forward hyper-plane signifies a bullish trend, and vice versa.

Neural Network

Inspired by how human’s biological neurons work, Neural Network in Forex is a machine learning tool that studies market data (technical and fundamental indicators values) and tries to predict the target variable (close price, trading result, etc.). There are two common contentious issue in Forex: Forex regression problem where we try to predict future trends, and Forex classification where we try to predict whether the trade will be profitable or otherwise. Neural Network will attempt to solve these two problems by:

  • Forex trading Regression – To predict tomorrow’s price, the following data is fed into Neural Network will include: Yesterday open price, Yesterday high price, Yesterday low price, Last 7 days high price, Last 7 days’ low price, and Relative Strength Index for Daily chart time frame.
  • Forex trading classification problem – To predict whether a trade will either be profit or loss, the following data is used: Yesterday open price, Yesterday high price, Yesterday low price, Last 7 days high price, Last 7 days’ low price, Relative Strength Index for Daily chart time frame.


Pros and Cons of using Machine Learning for Forex Trading

  • Improved market supervision: Due to volatility of forex markets, finite targets such as stop loss and exit points can sometimes be a challenge to a human trader to timely and successfully trigger; but with machine learning, these target points are precisely initiated.
  • Less human errors: Human trading is prone to errors mainly culminating from tiredness and clumsiness; but with machine learning, there is efficiency enhancement and maintenance of consistency throughout trading sessions.
  • Limited Fields and Determinism: Forex market isn’t a linear problem where there are easily definable variables; contrarily, it is characterized by volatile parameters that make it hard to understand – leave alone react to them in real-time. In addition, forex is a non-deterministic market, for example, the same input can have a very different outcome in different environments
  • Measuring success: Success might sometimes be relative when it comes to the deployment of machine learning in trading. Whereas the success of a machine learning is commonly measured in accordance to the net profit of all the trades it was involved in, there is a tendency to assess it based on the percentage of successful trades; the problem with the latter is that one big bad trade can render useless multiple small successful trades.


Machine Learning is an asset in Forex trading, but it is time-consuming and very costly to deploy; therefore, it is mainly the big players such as banks and financial institutions that are currently using it. Until recently… BlackALGO, a 15-years-old company, is making it available for everyone by allowing copy trading of trading signals generated by their artificial intelligence systems.