Comment on Kite charts update - Trading from chart & more
can you add relative strength comparison with a nifty indicator (it’s not rsi)
here is pine code for reference
study(“Relative Strength Comparison”, shorttitle=”RSC”)
a = tickerid
b = input(“NSE:NIFTY”, type=symbol, title=”Comparison Index”)
len = input(50, type=integer, minval=1, title=”Comparison Period”)
ma_len = input(10, type=integer, minval=1, title=”Moving Average Period”)
as = security(a, period, close)
bs = security(b, period, close)
zeroline = 0
crs = ((as/as[len])/(bs/bs[len]) – 1)
ma = sma(crs, ma_len)
zero_color = (crs >= 0) ? green : orange
plot_color = (crs >= ma) ? green : orange
ma_color = (crs >= ma) ? green : orange
fill_color = (crs >= ma) ? green : orange
hzplot = plot(zeroline, title=”Horiz. Axis”, color=zero_color, linewidth=1)
crs_plot = plot(crs, title=”CRS”, color=plot_color, linewidth=2, transp=0)
ma_plot = plot(ma, title=”Moving Average”, color=ma_color, transp=0)
fill(plot1=crs_plot, plot2=hzplot, color=fill_color, transp=70)