Dual Moving Average Reversion Strategy
Overview
The Dual Moving Average Reversion Strategy is a typical short-term mean reversion trading strategy. The strategy generates trading signals by two moving averages with different parameter settings. It aims to gain profits when trend reversal happens.
Strategy Logic
The strategy uses two moving averages to generate trading signals. The first MA maopening is used to determine the trend direction. The second MA maclosing is used to generate trading signals.
When maopening goes up, it indicates the current market is in an uptrend. When maopening goes down, it indicates the current market is in a downtrend. maclosing is multiplied by a coefficient greater than 1 to make it more sensitive for generating early reversal signals.
Specifically, when maopening goes up and maclosing crosses below maopening, it indicates a trend reversal. The strategy will open short position. When maopening goes down and maclosing crosses above maopening, it indicates a trend reversal. The strategy will open long position.
The parameters of the strategy include MA type, length, data source etc. The trading performance can be optimized by adjusting these parameters. There are also some configurable options such as entry rule, stop loss etc.
Advantage Analysis
The main advantages of the Dual MA Reversion Strategy are:
-
Small drawdown, suitable for short-term trading. The fast moving averages can quickly capture short-term reversals with smaller drawdowns.
-
Simple to implement and easy to grasp. The crossover of two MAs generates clear trading signals.
-
Highly configurable with multiple adjustable parameters. The parameters of two MAs and coefficients can be optimized.
-
Easy to automate with clear logic flow. The simple logic and high frequency trading make it very suitable for automated trading.
-
Controllable risk with stop loss mechanism. Moving stop loss or value stop loss can limit the loss of single trade.
Risk Analysis
There are also some risks of the strategy:
-
Lagging of MA crossover signals. The MAs themselves lag behind the price. The crossover may happen after the trend has reversed for some time.
-
Risk of whipsaw trades. The reversed trend may quickly reverse again, causing consecutive losses.
-
Drawdown still exists. Though stop loss limits the single loss, consecutive stop loss can still lead to large drawdowns.
-
Overfitting risk. Excessive parameter optimization may lead to overfitting and poor performance in live trading.
The solutions include:
-
Optimize parameters to find faster MAs.
-
Add filters, like volume and volatility indicators, to avoid whipsaw trades.
-
Adjust stop loss position to lower the probability of consecutive stop loss.
-
Robustness test of parameter sets to evaluate overfitting risks.
Improvement Directions
The strategy can be further optimized in the following aspects:
-
Test different types of MAs to find more sensitive ones, like KAMA, ZLEMA etc.
-
Optimize MA lengths to find the optimal combination. Usually shorter periods have better performance.
-
Test different data sources, like close, median price, typical price etc.
-
Add trend filter to avoid unsuitable reversal signals, like Donchian Channel.
-
Add other indicators for confirmation, like MACD, OBV etc.
-
Enhance risk management mechanisms, like moving stop loss, maximum account loss etc.
-
Portfolio optimization to find the optimal asset allocation.
-
Robustness test of parameters to evaluate overfitting risks.
Conclusion
The Dual MA Reversion is a simple and practical short-term trading strategy. It is suitable for capturing short-term reversals with quantitative trading. However, risks like lagging and whipsaw trades exist. The strategy can be improved by optimizing parameters, adding filters, enhancing risk control etc. to develop a stable and efficient strategy with good real trading performance.
/*backtest
start: 2023-10-17 00:00:00
end: 2023-11-16 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy(title = "hamster-bot MRS 2", overlay = true, default_qty_type = strategy.percent_of_equity, initial_capital = 100, default_qty_value = 100, pyramiding = 9, commission_value = 0.045, backtest_fill_limits_assumption = 1)
info_options = "Options"
- 1

