我的指示器看起来不像TradingView内置的随机RSI指示器。我如何才能获得熟悉的外观,以复制st-RSI指示器?
下面是显示我的代码和TradingView指示符之间差异的screen shot
//@version=3
study("Stoch-RSI")
//smooth = (close + close[1] + close[2]) /3
smooth = close
p_k = stoch(rsi(smooth,14),high,low,14)
p_d = 0.0
for i = 1 to 3
p_d := p_d + p_k[i]
p_d := p_d / 3
plot(p_k*30,color=orange)
plot(p_d*30,color=purple)
plot(close)曲线应与tradingview指示器相同
发布于 2019-04-29 01:39:53
公式应该是这样的:
study(title="Stoch-RSI")
band1 = hline(20)
band0 = hline(80)
fill(band1, band0, color=purple,transp=90)
smoothK = input(3, minval=1)
smoothD = input(3, minval=1)
lengthRSI = input(14, minval=1)
lengthStoch = input(14, minval=1)
src4 = input(close, title="RSI Source")
rsi1 = rsi(src4, lengthRSI)
k = sma(stoch(rsi1, rsi1, rsi1, lengthStoch), smoothK)
d = sma(k, smoothD)
plot(k, color=blue)
plot(d, color=red)
h0 = hline(80, linestyle=dotted)
h1 = hline(20, linestyle=dotted)https://stackoverflow.com/questions/55884218
复制相似问题