What is an Automated Strategy?
An automated trading strategy is a set of rules and conditions that can create and execute trading orders without human intervention. Typically, it refers to software designed to integrate with trading platforms such as MetaTrader, cTrader, or NinjaTrader.
An automated strategy generally consists of three modules:
-
Analysis Module: Usually based on technical analysis and market statistics.
-
Decision-Making Module: Selects positions and determines position sizes (Money Management).
-
Execution Module: Enters, modifies, or closes trading orders as needed.
Two Different Approaches to Automated Strategy Building
There are two main approaches to building an automated trading strategy:
1. Model-Based Strategy Building
Model-based strategies rely on market theories that are fitted to market data. This approach involves extensive experimentation and trial and error. These strategies are relatively easy to implement, as they don’t require extensive technical resources for data analysis. Common variables used in model-based strategies include:
- Mean Reversion
- Market Correlations
- Seasonality
- Volume Clusters
- Order Book
- Price Patterns
- Price Gaps
2. Data-Driven Strategy Building
Data-driven strategies are based on analyzing historical market data and data mining. By examining massive amounts of data, these strategies aim to identify rules and predictive patterns. They are considerably more complex and require significant technical resources for effective data analysis.
For retail traders interested in data-driven strategies, StrategyQuant is a valuable platform. It offers professional tools used by quants and hedge funds to create portfolios of trading strategies in a quantified way. ► StrategyQuant Review -Trading Strategy Building
The Decision-Making Module
An efficient automated strategy should include a decision-making module capable of answering the following questions:
-
Which assets or asset classes should be traded?
-
In which direction should these assets be traded (Long/Short)?
-
What is the overall cost of trading (spreads, commissions, overnight swaps)?
-
Are there any hidden risks (slippage, market correlations, etc.)?
-
What is the optimal time to trade these assets?
-
What is the optimal position size (money management)?
-
What types of trading orders should be used (pending orders, take-profit, stop-loss)?
Basic Model-Based Automated Trading Strategies
A wide variety of automated trading strategies can be applied in the Foreign Exchange market. Many traders even combine multiple strategies to build multi-trading systems that can adapt to various market conditions.
Here are some popular model-based strategies:
(1) Trend-Following Automated Strategy
A trend-following strategy aims to identify and follow strong price trends using historical data and basic technical analysis:
-
Deciding if the market is trending or ranging
-
Eliminating market-noise by applying a lowpass filter
-
Recognizing Historical Support & Resistance points
-
Trading S&R breakouts
-
Confirming breakouts with volume bars or TA indications (MACD, etc.)
-
Trading price and Moving Averages crossovers (i.e. 50-day or 200-day SMA)
(2) Volatility-Based Automated Strategy
Several automated strategies are based exclusively on volatility. These include volatility-expansion strategies, volatility-breakout strategies, and others. The volatility-expansion strategy focuses on sudden changes in volatility, where price gaps can play a decisive role during these expansions.
-
Combining market volatility with price metrics (price gaps are important)
-
TA tools that can be used include Bollinger Bands, ATR, Parabolic SAR, and etc.
-
The strategy targets small profits but it offers a high winning percentage
(3) Mean-Reversion Automated Strategy
The Mean-Reversion strategy is based on the statistical fact that prices revert to their mean about 80% of the time. In other words, markets trend only 20% of the time and range 80% of the time. As a result, highs and lows present good trading opportunities, as prices are expected to return to their mean.
-
Trading the fact that 80% of all times the price returns to its mean
-
Calculating the mean using historical data
-
Filtering data by applying a highpass filter
-
Identifying a basic price range
-
The breaking of the range may also trigger trades
(4) News-Event Algorithmic Strategy
Automated trading can be especially useful for trading news events. A simple news-event strategy may open positions based on the difference between actual data and market consensus. More sophisticated strategies attempt to quantify and trade on more complex news items.
At a Glance:
-
Quantifying scheduled/unscheduled news releases
-
Determining the impact of news on particular markets/assets
-
Avoiding stop-hunting techniques on major news releases
(5) Market Sentiment Automated Strategy
A market sentiment automated strategy aims to quantify investor sentiment using a wide variety of data sources, such as:
-
Fear & Greed Index
-
COT report (lagging indicator)
-
Options Put/Call Ratio
-
Social Media (data-mining)
-
Other online sentiment measures
(6) Other Automated Strategies
There are many other automated trading strategies:
-
Arbitrage and Statistical Arbitrage automated strategies
-
Market Cycle automated strategies (detecting the dominant market cycle)
-
Price Clusters automated strategies (Support and resistance)
-
Volume Weighted Average Price (VWAP) automated strategies
-
Time Weighted Average Price (TWAP) automated strategies
Strategy Building and Risk Management
Risk management is a crucial factor for the success of any automated strategy. While there are both systematic and non-systematic risks, only systematic risk can be managed. The main categories of systematic risk include:
-
(i) Market Risk (unfavorable price movement)
Risk Management: Position sizing (i.e. allocating less than 2% of the available capital on any position)
-
(ii) Extreme-Volatility Risk
Risk Management: Adding volatility filters and time parameters (i.e. not trading during scheduled news releases)
-
(iii) Slippage on Order Execution
Risk Management: Adding filters and trading only with real ECN brokers
-
(iv) Market Correlations (simple market correlations or Intermarket correlations)
Risk Management:: Incorporating correlation parameters based on historical data
-
(v) Software/Hardware Failures
Risk Management: Using a Virtual Private Server (VPS), and always entering a stop-loss
-
(vi) Latency (refers to time delays between requests and responses)
Risk Management: The best solution again is by using a VPS which is located close to your broker’s servers.
Money Management
The key components of a money management system include position sizing and trading orders (such as stop-loss, take-profit, trailing stop, OCO, etc.). However, money management is a broader concept that may also incorporate other important parameters, including risk management.
The Kelly Formula
Introduced by John L. Kelly, this formula can calculate how much to risk on any individual trade position.
-
Optimum Size (%) = W – (1 – W) / R
Where:
- Optimum Size (%) = percentage of capital to be put into a single trade.
- W = The historical winning percentage of a trading system
- R = The Historical Average Profit/Loss ratio
There is also an expanded version of the formula that appeared in Thorp’s interview in the book Hedge Fund Market Wizards:
-
F = PW - (PL / ($W / $L))
Where:
- F = Fraction of capital to bet
- PW = Probability of winning the bet
- PL = Probability of losing the bet
- $W = Dollars won if the bet is won
- $L = Dollars lost if the bet is lost
Incorporating Extra Parameters
Many other parameters can be used to limit the risk exposure of an automated strategy.
- Maximum drawdown (%)
- Time parameters
- Stopping when consecutive losers occur
- Stop trading during news-releases
- The maximum amount of accepted dollar losses
Backtesting Automated Strategies
Backtesting is the process of evaluating an automated strategy’s performance using historical data. It involves reconstructing trades that would have occurred during a past period and calculating the results. Backtesting offers several benefits, including:
- Evaluating fast multiple strategies
- Selecting among a great number of different strategies
- Leads to Strategy optimization
- Final verification
Key Backtesting Statistics
- Pip value of net profit/loss
- Max Drawdown % (measuring the maximum peak-to-trough decline during a specific period)
- Maximum Exposure % (measuring the maximum percentage of capital allocation)
- Win-to-loss Ratio
- Winning/Losing streak
- Annualized percentage returns
- Sharpe Ratio (comparing returns with the standard deviation of those returns)
Monte Carlo Analysis
Monte Carlo refers to a set of techniques used to measure uncertainty. It involves simulating various sources of uncertainty that can affect the value of a portfolio. The major advantage of the Monte Carlo method is its ability to handle increasing dimensions of uncertainty as the problem grows.
Advanced Backtesting with StrategyQuant
The StrategyQuant platform allows users to generate and backtest thousands of different entry and exit conditions, order types, and price levels to identify the best-performing automated strategies based on specific criteria (e.g., Return vs. Drawdown, Sharpe ratio, etc.).
-
Automated backtesting based on a wide variety of parameters
-
Using randomness to test a strategy in any conditions
-
Ideal re-optimization process using 2 separate modules
-
Robustness testing
Walk-Forward Optimization
-
Monte Carlo techniques for testing the quality of automated strategies
-
Re-testing strategies for a different market or timeframe
-
Built-in walk-forward optimizer and cluster analysis tools
► StrategyQuant and the free trial
Backtesting Principles
The key to successful backtesting is not to treat it as an isolated process. Backtesting is a dynamic part of a broader trading process that also includes customization and optimization of the trading strategy.
-
Combine backtesting with strategy optimization and customization
-
Perform multiple backtesting experiments covering all market conditions (trending, ranging, choppy, etc.)
-
Backtest your automated strategy over periods including both normal and abnormal market conditions
-
Avoid over-optimization, as it leads to results tailored only to past market conditions
-
Consider volatility statistics, especially when using high trading leverage
-
Remember that successful backtesting can never guarantee future results — past performance may not predict future outcomes
■ Selecting, Managing, and Backtesting Automated Trading Strategies
George M. Protonotarios for ForexAutomatic.com (c)
RESOURCES:
-
«Building Automated Trading Strategies» -George Protonotarios (2018)
-
Generalizing the Kelly Criterion -Boyles Asset Management, LLC (2014)
-
Hedge Fund Market Wizards: How Winning Traders Win -Jack D. Schwager, Ed Seykota (2012)
READ MORE ON FOREX AUTOMATIC
• COMPARE
□ Compare Expert Advisors
□ Compare Trade Systems
□ Compare Platforms
□ Compare Forex Brokers
• GUIDES
► Get Started
► Automated Trading
► Forex Rollover Rate
► Automated Strategies
► Intermarket Analysis
► Learning Systems
► Trading Tips
► Money Management
► Forex Scalping
• EAs
► Expert Advisors Guide
► Building Custom EAs