ํ”Œ์ขŒ๊ฐ€ ์˜ฌ๋ ค์คซ์ง€๋งŒ ๊ทธ๊ฑด ์ง€ํ‘œ ๋‘์นธ ๋จน์„๊ฑฐ ๊ฐ™์€๋Œ€ ๋‚˜๊ฐ™์€ ๊ตฅ์งœ๋ฎค๋ฃŒ์ถฉ๋“ค์€ ํ•œ์นธ์ด ์•„์‰ฌ์šด ๊ด€๊ณ„๋กœ ๋”ฐ๋กœ ์†Œ์Šค๋ฅผ ์งœ์„œ ์“ฐ๋ฉด ๋Œ„๋‹ค


-----------์ดํ•˜ ์†Œ์Šค---------------

//@version=4

study("RSI")

//@version=4


src = close

len = input(14, minval=1, title="Length")

up = rma(max(change(src), 0), len)

down = rma(-min(change(src), 0), len)

rsi = down =[์ด๊ฑฐ์‚ญ์ œ]= 0 ? 100 : up =[์ด๊ฑฐ์‚ญ์ œ_๊ธˆ์ง€์–ด๋•Œใ…ใ…์‹œ]= 0 ? 0 : 100 - 100 / (1 + up / down)

plot(rsi, title="RSI", color=color.black)



level_70rsi = rsi > 70 ? rsi : na

level_30rsi = rsi < 30 ? rsi : na



band0 = plot(series = 70, linewidth=0, color = color.black, transp = 100)

band1 = plot(series = 30, linewidth=0, color = color.black, transp = 100)

plot0 = plot(series = level_70rsi, linewidth=0, transp=100)

plot1 = plot(series = level_30rsi, linewidth=0, transp=100)


fill(band1, band0, color= color.black, transp=90)


fill(band0, plot0, color= color.green, transp = 60)

fill(band1, plot1, color= color.red, transp = 60)

-------------------------------------------------------





๊ทธ๋Ÿฌ๋ฉด ์ด๋Ÿญ๊ฐœ ๋‚˜์˜ด




์„ค์ •์—์„œ ์Ÿค๋„ค๋“ค ์ฒดํฌ ํ’€์–ด์ฃผ๊ณ  ์“ฐ๋ฉด ๋Œ