Type/to search

Double Moving Average Crossover Trading Strategy

Common strategy
Created: 2023-12-27 16:07:49
Last modified: 3 years ago
1
Follow
1802
Followers

img

Overview

This strategy generates buy and sell signals based on the golden cross and death cross of moving averages. Specifically, it uses a 5-day exponential moving average (EMA) and a 34-day double exponential moving average (DEMA). When the short-term 5-day EMA crosses above the long-term 34-day DEMA, a buy signal is generated. When the short-term 5-day EMA crosses below the long-term 34-day DEMA, a sell signal is generated.

Strategy Logic

  1. Calculate the 5-day EMA and 34-day DEMA
  2. Generate a buy signal when the short-term 5-day EMA crosses above the long-term 34-day DEMA
  3. Generate a sell signal when the short-term 5-day EMA crosses below the long-term 34-day DEMA
  4. Option to trade only during specific trading sessions
  5. Option to use trailing stop loss

This strategy combines both trend following and moving average crossover factors for stable performance. Moving averages as a trend following indicator can effectively identify market trends; The EMA and DEMA combination can effectively smooth price data to generate trading signals; The crossovers between short-term and long-term moving averages can provide early trading signals when major trend changes.

Advantage Analysis

  1. Simple and clear strategy logic, easy to understand and implement
  2. Combination use of moving averages considers both trend judgment and price data smoothing
  3. Crossovers between short-term and long-term moving averages can provide early signals at major turning points
  4. Parameters can be optimized to adjust moving average lengths for different products and timeframes
  5. Integrating two factors can improve strategy stability

Risk Analysis

  1. More false signals may occur in ranging markets
  2. Inappropriate moving average lengths may cause signal lagging
  3. Improper trading hours and stop loss settings may affect strategy profitability

These risks can be reduced by adjusting moving average lengths, optimizing trading hours, and setting reasonable stop loss.

Optimization Directions

  1. Adjust moving average length parameters for different trading products and timeframes
  2. Optimize trading session parameters to trade during most active periods
  3. Compare fixed stop loss vs trailing stop loss
  4. Test impact of different price source options on strategy

Conclusion

This strategy generates trading signals through double moving average crossovers, combined with trend following and data smoothing techniques. It is a simple and practical trend following strategy. Through parameter tuning and logic refinement, it can adapt to different products and timeframes, provide early signals at major trend changes, and avoid false signals. Worth recommending and applying.

Source
Pine
/*backtest
start: 2023-11-01 00:00:00
end: 2023-11-30 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
args: [["v_input_1",false]]
*/

//@version=2
strategy(title='[STRATEGY][RS]MicuRobert EMA cross V2', shorttitle='S', overlay=true)
USE_TRADESESSION = input(title='Use Trading Session?', type=bool, defval=true)
Strategy parameters
Strategy parameters
Use Trading Session?
Use Trailing Stop?
Trade Session:
Trade Size:
Take profit in pips:
Stop loss in pips:
EMA length:
DEMA length:
Price source:
Comment
All comments (0)
No data
No data
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)