Automated and Algorithmic Trading Tutorial
The Foreign Exchange is a fully-decentralized market where international currencies are traded over-the-counter. As there is no specific center that controls the raw of currency transactions, there is no single exchange rate for every pair. Nonetheless, due to currency arbitrage, exchange rates tend to trade very close to one another. Moreover, the Foreign Exchange market is extremely liquid with daily volumes exceeding 4 trillion US dollars. This combination of a decentralized market structure and enormous liquidity creates the perfect environment for the development of automated trading systems.
Automated and Systematic Trading
Automated trading refers to the process of trading the global financial markets without any human intervention. Automated trading is a branch of systematic trading and consequently, all automated trading systems are systematic systems. Systematic trading assumes:
- A rules-driven trading strategy that is based on objectively computable inputs
- The implementation of the strategy by eliminating the human emotional factor
General Categories of Automated Trading
According to Mitra, di Bartolomeo, and Banerjee (2011), automated trading can be classified into five main categories:
(i) Algorithmic Executions (The category that interests us the most)
(ii) Statistical Arbitrage (Exploiting trade opportunities deriving from market inefficiencies)
(iii) Predatory Trading (The practice of entering thousands of orders while expecting to execute only a tiny fraction of them)
(iv) Crossing Transactions (transacting with another entity without exposing the orders to other market participants)
(v) Electronic Liquidity Provision
How Automated Trading Differs from Algorithmic Trading?
Automated trading is almost considered synonymous with algorithmic trading, however, there is a difference in how these two methods approach the market. Automated trading refers to the automation of everyday manual trading processes. Automated trading usually focuses on the prediction of asset price movement based on a recognizable price trend, macroeconomic indications, news releases, and many other events.
On the other hand, algorithmic trading refers to the research and analysis of market conditions and trading data in order to develop efficient instructions and rules. It includes a wide variety of parameters such as price, time, and volume.
The two different approaches, at a glance:
- Automated trading focuses on the automation of the trading processes and especially as concerns execution
- Algorithmic trading focuses on the automation of trading research and analysis by incorporating an execution module
Algorithmic trading or else Algo trading uses computer algorithms that follow a defined set of rules and instructions to trade the global markets. These algorithms analyze the dynamics of demand/supply and create market and pending orders. The whole process excludes human intervention and it is based on the following fundamental principles:
- Financial Markets are not perfectly efficient (at least for short periods of time)
- Financial Markets have a finite depth
- Historical results have some predictive ability (Sharpe 1994)
- The financial data (price and quantity) are driven by human psychology, and consequently, are random and unstable
- Regularities in financial data do exist, but only for short periods of time. Windows of opportunity will close in the near future
Components of an Algorithmic System
An algorithmic system incorporates two basic components:
- The Forecasting Module
Forecasting based on the analysis of trends and changes in the dynamics of demand/supply.
- The Action Module
Entering pending and market orders at selected price and time (opening, modifying, and closing trading orders)
Modules for Creating Forecasting Indicators
- Dynamic changes in Demand/Supply (i.e. analyzing the volume of orders)
- Volume Clusters (changes in volume clusters can forecast upcoming changes in demand/supply)
- Asset Pricing Inefficiencies (divergences between the price of individual assets and other key linked assets)
- Intermarket Correlations (correlations between different asset classes -for example AUDUSD and gold)
- News Effect (the way the market reacts to news can create predictable patterns)
Advanced Tools for Creating and Optimizing Algorithmic Trading Systems
- Volume Breakout Analysis
- Order Book Analysis
- Time Series Analysis
- Pattern Recognition
- Market Sentiment Measures (using data mining)
- Intermarket Correlations Analysis
- Historical Backtesting
- Monte-Carlo Simulation (using random sampling to solve deterministic problems)
- Walk-Through Optimization
- Sharpe/Sortino Ratios
- Hamilton–Jacobi–Bellman (HJB) Equation
- Queuing Theory
Algorithmic Trading and the Role of Institutional Players
Algo strategies are applied by many hedge funds and other specialized financial firms. Institutional traders use a wide variety of sophisticated systems for multiple purposes, for example, to profit from arbitrage. According to the Bank of England (2017), there are two mega-trends:
(i) Data-driven modeling techniques that combine pattern recognition, computational statistics, predictive analytics, and artificial intelligence
(ii) A rapidly increasing amount of granular data often referred to as Big Data
Quantitative Analysis & Machine Learning
Quantitative analysis uses a wide variety of market data in order to create models capable of identifying trading opportunities. The forecasting modules of quantitative analysis mainly analyze fundamental and statistical data (mean reversion, etc.). Backtesting using historical data enables the optimization of results.
Machine learning is a much more demanding task. Machine learning refers to the process of using statistical tools and techniques in order to enable computer systems to ‘Learn’. Learning means improving the performance of the system without any direct human intervention. A machine learning system incorporates the following components:
- Specific problems to be solved
- Data sources
- Models that analyze data
- Optimization algorithms
- Validation and backtesting modules
Why Using an Automated Trading System?
An automated system can automate the whole trading process, from the analysis-based trading decision to market execution. The multi-tasking power of an auto-trading system enables the 24/7 simultaneous analysis of a great variety of Forex exchange rates in multiple timeframes. Furthermore, trading decisions are made without any emotions, stress, or fatigue. That means by developing an automated trade system you can save a lot of time and optimize your overall results by excluding the human factor out of the decision-making process.
The Use of Forex Robots (Expert Advisors)
Retail traders implement automated strategies by using a simple Expert Advisor (EA) or else Forex robot. A Forex robot is a small piece of computer code that is designed to run on a specific trading platform. The most popular auto-trading platforms for retail traders are MetaTrader-4, MetaTrader-5, cTrader, TradeStation, and NinjaTrader. An Expert Advisor uses algorithms to analyze the market and spot opportunities based on price movements and corresponding volumes. In addition, it incorporates a set of money management rules that dictate position-sizes, and limit risk. There are also several filters that protect the trading account from choppy market conditions, including high slippage, wide spreads, market correlations, expected news-releases, etc.
Building a Custom Automated Trading System
Nowadays, building an automated trading system is easier and cheaper than ever before. There are plenty of applications that allow the transformation of ideas into fully-operating trading systems, without the need for programming skills.
As there is no need for programming skills anymore, all retail traders can get involved in building automated systems.
Minimum Configuration for Retail Traders
These are the minimum requirements for using an Expert Advisor:
- A dedicated ECN trading account
-Allowing auto-trading and scalping
-Offering competitive pricing (tight spreads and low commissions)
-Offering MetaTrader or a similar auto-trading platform
- A minimum of $500 (to open the ECN account)
- Installing an Expert Advisor (commercial or custom-made)
- A VPS Service (generally offers better and more reliable results than using your own computer)
■ Automated and Algorithmic Trading Guide
George M. Protonotarios
- «Automated Analysis of News to Compute Market Sentiment: Its Impact on Liquidity and Trading» -G. Mitra, D. di Bartolomeo and A. Banerjee (2011)
- «Building Automated Trading Strategies» -George Protonotarios (2018)
- Automated Trading with Machine Learning on Big Data, Dymitr Ruta, Conference Paper · June 2014
- Professional Automated Trading Theory and Practice (Eugene A. Durenard)