Bidirectional Moving Average Reversion Trading Strategy
Overview
The Bidirectional Moving Average Reversion Trading Strategy is a quantitative trading strategy built on the theory of price mean reversion. This strategy captures price reversal opportunities by setting up multiple moving averages and entering the market when the price deviates significantly from the moving averages, and exiting when it reverts back.
Strategy Logic
The core idea of this strategy is price mean reversion, which suggests that prices tend to fluctuate around an average value, and have a higher chance of reverting back when they deviate too far from the average. Specifically, this strategy sets up three groups of moving averages: entry moving averages, exit moving averages, and stop-loss moving averages. It will open corresponding long or short positions when prices hit the entry moving averages; close positions when prices hit the exit moving averages; and control losses with stop-loss moving averages in case prices continue to trend without reverting back.
From the code logic perspective, there are two entry moving averages - long and short - consisting of fast and slow moving averages respectively. The deviation between them and the price determines the position size. In addition, the exit moving average is a separate moving average that signals when to close the positions. When prices hit this line, existing positions will be flattened.
Advantage Analysis
The main advantages of the bidirectional moving average reversion strategy include:
- Capturing price reversals, suitable for range-bound markets
- Controlling risks through stop losses
- Highly customizable parameters for adaptability
- Easy to understand, convenient for parameter optimization
This strategy works well with low volatility instruments that have relatively small price swings, especially when entering range-bound cycles. It can effectively capture opportunities from temporary price reversals. Meanwhile, the risk control measures are quite comprehensive, capping losses within reasonable ranges even if prices do not revert back.
Risk Analysis
There are also some risks associated with this strategy:
- Chasing trends risk. Consecutive new positions may lead to liquidation during strong trending moves.
- Excessive price swings risk. Stop losses could be hit by increased volatility.
- Parameter optimization risk. Inappropriate parameter settings may lead to significant underperformance.
Some ways to mitigate the above risks include:
- Limiting new entries to avoid overtrading
- Reducing position sizes to limit liquidation risks
- Optimizing parameters like moving average periods and exit line multipliers
Optimization Directions
There is also ample room to further optimize this strategy:
- Add additional entry logic to prevent trend chasing
- Incorporate adaptive position sizing against volatility
- Experiment with different types of moving averages
- Machine learning for automated parameter optimization
- Incorporate trailing stops for more dynamic risk management
Conclusion
The bidirectional moving average reversion trading strategy aims to profit from price reversals after significant deviations from its moving average levels. With proper risk control measures, it can achieve consistent profits through parameter tuning. While risks like chasing trends and excessive volatility still exist, they can be addressed through improving entry logic, reducing position sizes and more. This easy-to-understand strategy deserves further research and optimization from quantitative traders.
/*backtest
start: 2023-12-15 00:00:00
end: 2024-01-14 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 = 30, pyramiding = 1, commission_value = 0.1, backtest_fill_limits_assumption = 1)
info_options = "Options"
- 1

