Type/to search

An Optimization of Dual Moving Average Trend Following Strategy Based on Indicators Combination

Common strategy
Created: 2024-02-01 15:13:13
Last modified: 3 years ago
1
Follow
1802
Followers

img

Overview

This strategy generates trading signals by calculating fast and slow moving average lines and combining Parabolic SAR indicator. It belongs to the trend following strategy. When the fast MA crosses over the slow MA, long position will be opened. When the fast MA crosses below the slow MA, short position will be opened. Parabolic SAR is used to filter fake breakouts.

Strategy Principle

  1. Calculate fast and slow moving average lines. The parameters can be customized.
  2. Compare the two MA lines to determine market trend. When fast MA crosses over slow MA, it indicates bullish trend. When fast MA crosses below slow MA, it indicates bearish trend.
  3. Further confirmation is made by checking if close price is above/below fast MA. Only when fast MA crosses over slow MA and close price is above fast MA, long signal is generated. Only when fast MA crosses below slow MA and close price is below fast MA, short signal is generated.
  4. Parabolic SAR is used to filter fake signals. Only when all the three criteria are met, final signal is generated.
  5. Stop loss is set based on maximum tolerable loss. ATR indicator is used to calculate dynamic stop loss price.

Advantages

  1. MA lines determine market trend and avoid excessive trading in range-bound market.
  2. Dual filters lower risk of fake breakout significantly.
  3. Stop loss strategy effectively limits per trade loss.

Risks

  1. Indicator strategies tend to generate false signals
  2. No consideration of currency exposure risk
  3. Potentially miss initial trend in opposite direction

The strategy can be optimized in below aspects:

  1. Optimize MA parameters to fit specific product
  2. Add other indicators or models for signal filtering
  3. Consider real-time hedging or auto currency conversion

Directions for Optimization

  1. Optimize MA parameters to better capture trends
  2. Increase model diversity to improve signal accuracy
  3. Multi-timeframe verification to avoid being trapped
  4. Enhance stop loss strategy to increase stability

Conclusion

This is a typical dual moving average cross and indicators combination trend following strategy. By comparing fast and slow MA directions, market trend is determined. Various filter indicators are used avoid false signals. At the same time, stop loss function is implemented to control per trade loss. The advantage is that the strategy logic is simple and easy to understand and optimize. The disadvantage is that as a coarse trend tool, there is still room to improve signal accuracy, by introducing machine learning models for example.

Source
Pine
/*backtest
start: 2024-01-01 00:00:00
end: 2024-01-31 00:00:00
period: 4h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © sosacur01

//@version=5
Strategy parameters
Strategy parameters
Backtest Time Period
Filter Date Range of Backtest
Start Date
End Date
Long & Short Position
On/Off Long Postion
On/Off Short Postion
Slow MA Inputs
Slow MA Type
Slow MA Length
Slow MA Source
Fast MA Inputs
Fast MA Type
Fast MA Length
Fast MA Source
Parabolic SAR Inputs
Use Parabolic Sar?
Display Parabolic Sar?
Start
Increment
Maximum
Risk Management Inputs
ATR Length
Long Position - Stop Loss - ATR Multiplier
Short Position - Stop Loss - ATR Multiplier
% of Equity at Risk
Comment
All comments (0)
No data
No data
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)