OPEN-SOURCE SCRIPT

BTC RSI 35 이하 + 음봉 직후 양봉 (중복방지, 일봉 20일선 위)

31
//version=5
indicator("BTC RSI 35 이하 + 음봉 직후 양봉 (중복방지, 일봉 20일선 위)", overlay=true)

// === 일봉 기준 조건 ===
dailyClose = request.security(syminfo.tickerid, "D", close) // 일봉 종가
dailyMA20 = request.security(syminfo.tickerid, "D", ta.sma(close, 20)) // 일봉 20일선
aboveDailyMA = dailyClose > dailyMA20 // 일봉 종가가 20일선 위일 때만 true

// === RSI 계산 (1시간봉) ===
rsiLength = 14
rsi = ta.rsi(close, rsiLength)

// === 상태 변수 ===
var bool armed = false
var bool locked = false

// RSI 35 이하 → 무장(armed)
if (rsi <= 35)
armed := true

// RSI 40 이상 → 리셋
if (rsi >= 40)
armed := false
locked := false

// === BUY 조건 정의 (1시간봉 + 일봉 조건) ===
bearishPrev = close[1] < open[1] // 직전 봉 음봉
bullishNow = close > open // 현재 봉 양봉
buySignal = armed and not locked and bearishPrev and bullishNow and aboveDailyMA

// BUY 발생 시 잠금
if (buySignal)
locked := true

// === 차트 표시 ===
plotshape(buySignal, title="BUY", location=location.belowbar,
color=color.lime, style=shape.labelup, text="BUY", size=size.tiny)

// === 얼러트 조건 ===
alertcondition(buySignal, title="BUY Alert",
message="RSI 35 이하 + 음봉 직후 양봉 + 일봉 20일선 위 (1시간)")

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.