Heikin Ashi of Candle RSI
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © EW_T

//@version=5
indicator("HAoCRSI")

x = close/ta.rsi(close, 14)

hline(70, color=color.gray)
hline(50, color=color.gray, linestyle=hline.style_dotted )
hline(30, color=color.gray)
openx = open/x
highx = high/x
lowx = low/x
closex = close/x



float o = na
c = (openx + highx + lowx + closex) / 4
o := na(o[1]) ? (openx[1] + highx[1] + lowx[1] + closex[1]) / 4 : (o[1] + c[1]) / 2
h = math.max(highx, o, c)
l = math.min(lowx, o, c)

cancol = c > o ? color.green : color.red
plotcandle(o, h, l, c, color = cancol, wickcolor = cancol , bordercolor = cancol )