Buongiorno, chiedo la conversione del codice di questo indicatore …grazie 🙂
//@version=3
// Price Kijun Equilibrium Index
// idea from this twitter: https://twitter.com/Crypto_Analyst/status/898202561949429761
study(“Price vs Kijun”, overlay=false)
//Inputs
ks_bars = input(60, minval=1, title=”Kijun-Sen Bars”)
rc = close
middle(len) => avg(lowest(len), highest(len))
kijun = middle(ks_bars)
kijun_percent = ((rc/kijun) -1) * 100
p1 = plot(0)
p2 = plot(kijun_percent)
fill(p1, p2)
// optional
// horizontal lines on 20% and 30%, -20% and -30%
h1 = input(title=”Horizontal bar A”, type=float, defval=-30, minval=-100, maxval=100, step=1)
h2 = input(title=”Horizontal bar B”, type=float, defval=-20, minval=-100, maxval=100, step=1)
h3 = input(title=”Horizontal bar C”, type=float, defval=20, minval=-100, maxval=100, step=1)
h4 = input(title=”Horizontal bar D”, type=float, defval=30, minval=-100, maxval=100, step=1)
ha = hline(h1, title=’Line A %’, color=gray, linestyle=dotted, linewidth=1)
hb = hline(h2, title=’Line B %’, color=gray, linestyle=dotted, linewidth=1)
hc = hline(h3, title=’Line C %’, color=gray, linestyle=dotted, linewidth=1)
hd = hline(h4, title=’Line D %’, color=gray, linestyle=dotted, linewidth=1)