
This strategy combines Elliott Wave theory and 200-day moving average indicator to achieve automated trend following and profit taking trading. Its basic logic is to determine the trend direction when Elliott 5-wave patterns appear, and issue trading signals with the 200-day moving average as an auxiliary condition.
Elliott Wave theory divides market price fluctuations into 5-wave segments. Odd-numbered waves are motive waves and even-numbered waves are corrective waves. When the high points of Wave1, Wave3 and Wave5 push up in sequence, and Wave2 and Wave4 retract effectively in sequence, it is judged as an upward wave combination, which belongs to a bull market. The strategy goes long at this time. On the contrary, when the low points of Wave1, Wave3 and Wave5 push down in sequence, and Wave2 and Wave4 retract effectively in sequence, it is judged as a downward wave combination, which belongs to a bear market. The strategy goes short at this time.
The strategy also introduces the 200-day moving average indicator as an auxiliary judgment condition. Only when a bullish or bearish Elliott wave pattern is identified and the closing price of the day exceeds the 200-day moving average line can a long position be taken, and a short position can be taken only if the closing price of the day breaks below the 200-day moving average line.
After the long and short signals are issued, the opposite direction five waves exit the position.
This strategy integrates the advantages of wave theory and trend-following indicators, and performs well in capturing market key points and controlling trading risks. However, relying solely on price information means there is room for improving effectiveness in complex market conditions. Strict monitoring and continuous adjustment during live trading are necessary to achieve long-term steady profits.
/*backtest
start: 2024-01-26 00:00:00
end: 2024-02-25 00:00:00
period: 4h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
strategy("Elliott Wave Strategy with 200 SMA", overlay=true)
// Elliott Wave Strategy
wave1High = high[1]
wave1Low = low[1]
wave2High = high[2]
wave2Low = low[2]
wave3High = high[3]
wave3Low = low[3]
wave4High = high[4]
wave4Low = low[4]
wave5High = high[5]
wave5Low = low[5]
bullishWavePattern = wave3High > wave1High and wave4Low > wave2Low and wave5High > wave3High
bearishWavePattern = wave3Low < wave1Low and wave4High < wave2High and wave5Low < wave3Low
enterLong = bullishWavePattern and close > sma(close, 200)
exitLong = bearishWavePattern
enterShort = bearishWavePattern and close < sma(close, 200)
exitShort = bullishWavePattern
// Plotting 200 SMA
sma200 = sma(close, 200)
plot(sma200, color=color.blue, title="Moving Average 200")
// Displaying "Razer Moving 200" message on chart
if (enterLong)
label.new(bar_index, low, "Long on Moving 200", color=color.green, textcolor=color.white)
if (enterShort)
label.new(bar_index, high, "Short on Moving 200", color=color.red, textcolor=color.white)
if (enterLong)
strategy.entry("Long", strategy.long)
if (exitLong)
strategy.close("Long")
if (enterShort)
strategy.entry("Short", strategy.short)
if (exitShort)
strategy.close("Short")