Tass

RSI by PGT

RSI with border to 70/30 and 80/20
开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?
//
// @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)