This strategy combines 5 different types of moving averages, and generates trading signals when the directions of all 5 moving averages are consistent. The aggregation of multiple moving averages can effectively filter market noise and identify trend direction.
This strategy uses SMA, EMA, RMA, WMA and VWMA five kinds of moving averages. It calculates five 8-day fast MAs and five 144-day slow MAs. When all fast MAs are rising and all slow MAs are rising, it generates a long signal. When all fast MAs are falling and all slow MAs are falling, it generates a short signal.
This strategy generates trading signals when all major moving averages reach consensus on direction. It effectively utilizes strengths of different MAs while filtering some noise to identify market trend direction. Further enhancements like parameter optimization and indicator combos can improve strategy stability. Overall a simple and practical trend following strategy.
//@version=2 strategy(title="MACD Multi-MA Strategy", overlay=false ) src = close len1 = input(8, "FAST LOOKBACK") len2 = input(144, "SLOW LOOKBACK") ///////////////////////////////////////////// length = len2-len1 ma = vwma(src, length) plot(ma, title="VWMA", color=lime) length1 = len2-len1 ma1 = rma(src, length1) plot(ma1, title="RMA", color=purple) length2 = len2-len1 ma2 = sma(src, length2) plot(ma2, title="SMA", color=red) length3 = len2-len1 ma3 = wma(src, length3) plot(ma3, title="WMA", color=orange) length4 = len2-len1 ma4 = ema(src, length4) plot(ma4, title="EMA", color=yellow) long = ma > ma[1] and ma1 > ma1[1] and ma2 > ma2[1] and ma3 > ma3[1] and ma4 > ma4[1] short = ma < ma[1] and ma1 < ma1[1] and ma2 < ma2[1] and ma3 < ma3[1] and ma4 < ma4[1] strategy.entry("Long", strategy.long, when=long) strategy.entry("Short", strategy.short, when=short)