TRAC/Tether

Swing

56
//version=5
indicator("RSI 14 Golden Cross with Volume Break MA 20", overlay=true)

// Input parameters
rsi_length = input.int(14, title="RSI Length")
ma_volume_length = input.int(20, title="MA Volume Length")

// Get weekly data
weekly_rsi = request.security(syminfo.tickerid, "W", ta.rsi(close, rsi_length))
weekly_volume = request.security(syminfo.tickerid, "W", volume)
weekly_ma_volume = request.security(syminfo.tickerid, "W", ta.sma(volume, ma_volume_length))

// Check for RSI golden cross and volume break MA 20
rsi_golden_cross = ta.crossover(weekly_rsi, 50)
volume_break_ma = weekly_volume > weekly_ma_volume

// Plotting signals
plotshape(series=rsi_golden_cross and volume_break_ma, location=location.belowbar, color=color.green, style=shape.labelup, text="RSI GC + Vol Break MA 20")

// Plotting RSI and volume for reference
plot(weekly_rsi, title="Weekly RSI", color=color.blue)
plot(weekly_ma_volume, title="Weekly MA Volume", color=color.red)

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.