Tass

RSI by PGT

RSI with border to 70/30 and 80/20
Remove from Favorite Scripts Add to Favorite Scripts
//
// @author PGT
// 
// If you use this code in its original/modified form, do drop me a note. 
//
study("RSI", shorttitle="RSI PGT")
length=input(14)
ob=input(80, title="Overbought")
os=input(20, title="Oversold")

WiMA(src, length) => 
    MA_s=(src + nz(MA_s[1] * (length-1)))/length
    MA_s

calc_rsi_volume(fv, length) =>	
	up=iff(fv>fv[1],abs(fv-fv[1])*volume,0)
	dn=iff(fv<fv[1],abs(fv-fv[1])*volume,0)
	upt=WiMA(up,length)
	dnt=WiMA(dn,length)
	100*(upt/(upt+dnt))

rsi_v = calc_rsi_volume(close, length)

u=plot(ob, "80", gray, 2, dashed)
l=plot(os, "20", gray, 2, dashed)
fill(u,l,black)
plot(50, "Mediana")
plot(70, "70")
plot(30, "30")
plot(rsi_v, title="RSI", color=blue, linewidth=2)
syracusepro
3 months ago
what the variable fv stands for?
Reply
Ideas Scripts Chart
United States
United Kingdom
India
España
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Billing Sign Out