jinqian168

Jinqian168_V2

RSI, EMA of RSI, EMA of RSI's EMA, and Stochastic.
V2 added Price Bar Coloring. Buy when Orange or Green, Sell when Yellow or Red.
Script de código aberto

Dentro do verdadeiro espírito TradingView, o autor deste script publicou ele como um script de código aberto, para que os traders possam compreender e checar ele. Um viva ao autor! Você pode usá-lo gratuitamente, mas a reutilização deste código em uma publicação é regida pelas Regras da Casa. Você pode favoritá-lo para usá-lo em um gráfico.

Aviso legal

As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.

Quer usar esse script no gráfico?
//Created by Jinqian168.
//RSI, EMA of RSI, EMA of RSI's EMA, and Stochastic
//Updated Aug 5, 2015:  Added Price Bar Coloring.  Buy when Orange or Green, Sell when Yellow or Red.

study(title="Jinqian168_V2", shorttitle="Jinqian168_V2", overlay=false)
src = close, 
len = input(14, minval=1, title="RSI Length")
len2 = input(7, minval=1, title="EMA of RSI Length")
len3 = input(5, minval=1, title="EMA of eRSI 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))
eRSI = ema(rsi,len2)
eRSI_Avg = ema(eRSI,len3)

plot(rsi, title="RSI", style=line, linewidth=1, color=black)
plot(eRSI, title="EMA of RSI", style=line, linewidth=1, color=green)
plot(eRSI_Avg, title="EMA of eRSI", style=line, linewidth=1, color=red)
band1 = hline(70, title="OverBoughtRSI", linestyle=dashed, linewidth=1, color=purple)
band0 = hline(30, title="OverSoldRSI", linestyle=dashed, linewidth=1, color=purple)

length1 = input(5, minval=1), smoothK1 = input(3, minval=1), smoothD1 = input(3, minval=1)
k1 = ema(stoch(close, high, low, length1), smoothK1)
d1 = ema(k1, smoothD1)
plot(k1, title="FullK", color=blue)
plot(d1, title="FullD", color=gray)

h0 = hline(80, title="OverBoughtStochastic", linestyle=solid, linewidth=1, color=purple)
h1 = hline(20, title="OverSoldStochastic", linestyle=solid, linewidth=1, color=purple)

barcolor(eRSI > eRSI_Avg and rsi > eRSI_Avg ? green : eRSI >= eRSI_Avg and rsi <= eRSI_Avg ? yellow : eRSI < eRSI_Avg and rsi < eRSI_Avg ? red : eRSI <= eRSI_Avg and rsi >= eRSI_Avg ? orange : na)