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.
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).
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.
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.
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