The Dual Moving Average Golden Cross strategy is a quantitative trading strategy based on moving averages. By calculating moving averages of different periods, it judges market trends and trading opportunities. When the short-term moving average crosses above the long-term moving average, a golden cross is formed as a buy signal. When the short-term moving average crosses below the long-term moving average, a death cross is formed as a sell signal.
The core logic of the Dual Moving Average Golden Cross strategy lies in the smoothing characteristics of moving averages. Moving averages can effectively filter market noise and indicate general trend directions. The short-term moving average is more sensitive to price changes, capturing price fluctuation information over the recent period. The long-term moving average responds more slowly to recent price changes, reflecting the long-term trend of the market. When the short-term moving average crosses above the long-term moving average, it indicates the market is forming a new uptrend. When the short-term moving average crosses below the long-term moving average, it suggests the uptrend may be ending and one should consider exiting positions.
Another key point of the dual moving average strategy is the RSI indicator. RSI can effectively determine whether the market is in overbought or oversold status. By incorporating RSI, it avoids generating wrong trading signals around market turning points. This strategy will only generate buy and sell signals when RSI meets the criteria.
Specifically, the trading logic is as follows:
By combining multiple parameters, this strategy can effectively filter false signals and improve accuracy of trading decisions.
The Dual Moving Average Golden Cross strategy has the following advantages:
The risks associated with this strategy include:
To mitigate risks, optimizations can be made in the following aspects:
There is room for further enhancement for the Dual Moving Average Golden Cross strategy:
The Dual Moving Average Golden Cross strategy is a classic rule-based quantitative trading strategy. It’s easy to implement with flexible parameter tuning and good backtested results. It serves as a great starting point for novice quants. However, it has some intrinsic limitations. With further research and optimization, it can be enhanced into more intelligent and stable systems for sustained profitability.
/*backtest start: 2024-01-09 00:00:00 end: 2024-01-16 00:00:00 period: 1h basePeriod: 15m exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ //@version=4 //Based on Larry Connors RSI-2 Strategy - Lower RSI strategy(title="EA_3Minute_MagnetStrat", shorttitle="EA_3Minute_MagnetStrat", overlay=false) src = close, //RSI CODE up = rma(max(change(src), 0), 30) down = rma(-min(change(src), 0), 30) rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down)) //Criteria for Moving Avg rules ma20= vwma(close,20) ma50 = vwma(close,50) ma100= vwma(close,100) //Rule for RSI Color //col = ma30 > ma50 > ma200 and rsi <=53?lime: ma50 < ma200 and rsi >= 60?red : silver long1 = ma20 > ma50 and ma50 > ma100 and rsi < 50 short1 = ma20 < ma50 and ma50 < ma100 and rsi > 48.5 //plot(rsi, title="RSI", style=line, linewidth=1,color=col) //plot(100, title="Upper Line 100",style=line, linewidth=3, color=aqua) //plot(0, title="Lower Line 0",style=line, linewidth=3, color=aqua) //band1 = plot(60, title="Upper Line 60",style=line, linewidth=1, color=aqua) //band0 = plot(44, title="Lower Line 40",style=line, linewidth=1, color=aqua) //fill(band1, band0, color=silver, transp=90) //strategy.entry ("buy", strategy.long, when=long) //strategy.entry ("sell", strategy.short, when=short) //plot(long,"long",color=green,linewidth=1) //plot(short,"short",color=red,linewidth=1) // long = long1[1] == 0 and long1 == 1 short = short1[1] == 0 and short1 == 1 longclose = long[3] == 1 shortclose = short[3] == 1 //Alert strategy.entry("short", strategy.short,qty = 1, when=short) strategy.entry("long", strategy.long,qty=1, when=long) plot(long,"long",color=green,linewidth=1) plot(short,"short",color=red,linewidth=1) strategy.close("long",when=longclose) strategy.close("short",when=shortclose) //strategy.exit(id="long",qty = 100000,when=longclose) //strategy.exit(id="short",qty = 100000,when=shortclose) plot(longclose,"close",color=blue,linewidth=1) plot(shortclose,"close",color=orange,linewidth=1) //strategy.exit(id="Stop", profit = 20, loss = 100)