What is Algorithmic Trading and How Do You Get Started?

What is Algorithmic Trading and How Do You Get Started?

Reading time: 7 minutes

Algorithmic (algo) trading is growing rapidly. Traders and large institutions (think hedge funds) – including some of the industry's household names, such as Bridgewater Associates and Citadel – have already adopted this artificial intelligence (AI) and continue developing it to execute trades across all widely traded (liquid) financial instruments (as well as perform other tasks). Importantly, algorithmic trading can be used for both long-term investing and short-term speculation.

Trading systems are grouped into three categories: discretionary, non-discretionary, or a combination of the two: partially discretionary.

  • A discretionary trader, as the name implies, is impulsive and trades based on gut instinct. Few traders manage to achieve consistency using this approach.
  • Non-discretionary traders, which is what this post focusses on, refer to those who adopt an algorithmic trading strategy implemented through computer programs using code (mathematical models).
  • A partially discretionary trader employs a combination of discretionary and non-discretionary methods: traders take signals from a system and, based on their experience, decide whether the signal is valid or not.

At its core, algorithmic trading serves as a mechanical trading system coded to open and close trading positions based on predefined conditions. These conditions may be a price trigger (when or if price moves above x, enter a long trade, for example) or more complex and consider a range of parameters and technical indicators, such as moving averages used for mean reversion and trend following.

Unlike a discretionary trader, a non-discretionary trader tends to be calm and calculated. All traders, nevertheless, generally study technical and fundamental analysis, risk-management methods, and profit-taking strategies. After satisfactory testing/validating, they can use their systems in the live markets. An algorithmic trader or ‘system developer’ commonly uses programming languages like Python, Pinescript, and MetaQuotes for MetaTrader 4 (MT4) and MetaTrader 5 (MT5).

Test Your Ideas!

It cannot be overstated how important it is to test and validate your trading systems, measuring both profit and risk measures.

Validating or optimising your trading system is a necessary step in algorithmic trading. It must also be conducted over a satisfactory timescale, including all types of market conditions: historical trends and ranging markets. The backtest is carried out using in-sample data (this is where you optimise your strategy on historical data), and subsequently, you would need to test these optimised parameters using out-of-sample data (this is data unseen by the strategy). Walk Forward Optimisation is a commonly used technique involving optimising a small portion of data and testing on out-of-sample data. The resulting parameters of this test are recorded and then another batch of data are optimised. One common approach is to use 70% of the data to conduct an in-sample optimisation and the remaining 30% for out-of-sample testing.

The idea is to measure the system’s results for robustness: the profit and risk measures, such as the percentage of winning trades, drawdown, and the Sharpe ratio. Another important observation is to assess the smoothness of the equity curve. One thing to bear in mind, however, is that there will be a difference between your results derived from the in-sample and out-of-sample data. As long as the system is robust (has an edge and is profitable), it is something that could be considered for live trading.

Finally, curve fitting needs to be understood and addressed. Curve fitting is when an algorithmic trader finds the absolute best parameters for the tested data (fitting the parameters to the data). This type of system will only work on out-of-sample data if the data are the same as those in the in-sample data. As this will not happen, such a system is inherently problematic.

Benefits of Algorithmic Trading

  • The first (and most obvious) benefit of using an algorithmic trading system is that it reduces emotional connection. Discretionary traders (and partially discretionary traders) are often influenced by their emotions, whereas with algorithmic trading, much of the emotional influences are lessened (although there are times when algorithmic traders feel the need to tweak a system’s parameters that are triggered by emotions).
  • Algo traders are generally more disciplined as the process is automated and forces you to stick to the rules of your tested trading system. It also forces the algorithmic trader to adhere to their risk-management strategies, whereas, with discretionary systems, traders often move stop-loss orders or do not apply them at all.
  • Backtesting using an algorithmic system is quicker and more accurate than manual backtesting, as the emotional components are removed that human traders are often susceptible to. In fact, backtesting discretionary and even partial discretionary systems is much more open to human error and challenges: results are unlikely to be accurate.
  • High degree of flexibility. Like all trading systems, irrespective of whether you are discretionary or non-discretionary based, systems can be customised to meet the specific needs of each trading style. For example, traders can select the assets they want to trade, the order types best suited to their systems, and define their risk tolerance.

Disadvantages of Algorithmic Trading

  • If an algorithmic trading system malfunctions for any reason, this can lead to sizeable losses and even account ruin. This is why it is imperative to constantly monitor the system and ensure that it is always doing what it was designed to do.
  • Curve fitting is a serious concern and why algorithmic traders employ the use of both in-sample data and out-of-sample data.
  • Time taken to learn how to code can often discourage traders from pursuing algorithmic strategies.

How Can You Get Started?

  • The first, and probably most obvious, is to devise a trading system, an idea based on predefined parameters. It is recommended to keep things simple using technical analysis tools or a combination of technical and fundamental analysis.
  • Test your strategy and analyse the results. Beware of overfitting your system. A sufficient sample size and validating your system’s effectiveness across other markets can help combat curve fitting.
  • PineScript via TradingView could be something you may want to explore if you are just getting started as it provides you with all the data needed to begin with. It does take time to learn how to code, but it is time well spent. Alternatively, you can hire the skills of professionals to code your ideas to save time.


1. What is algorithmic trading?

Algorithmic trading is a set of codes designed to open and close trading positions based on defined parameters.

2. How important is it to test your trading strategies?

It is incredibly important to validate any trading strategies before trading them live using real money. This involves rigorous testing using in-sample and out-of-sample data.

3. Is learning to code difficult?

Learning to code trading strategies will be initially time-consuming, but it is certainly something that can be learned. Many traders do, however, simply employ the skills of professional coders to save time.

Start Trading
in Minutes

bullet Access 10,000+ financial instruments
bullet Auto open & close positions
bullet News & economic calendar
bullet Technical indicators & charts
bullet Many more tools included

By supplying your email you agree to FP Markets privacy policy and receive future marketing materials from FP Markets. You can unsubscribe at any time.

Source - database | Page ID - 39998

Get instant Updates in Telegram