[RS]RSIC - Oscilator Bands V0

EXPERIMENTAL: stashed and forgotten :p , forgot to publish this one.
untill recently was asked about it because it was used on another script :D
usage similar to how to read a rsi .
Remove from Favorite Scripts Add to Favorite Scripts
// @author RicardoSantos
// RSI inspired oscilator bands channels.
// Can be interpreted as a RSI oscilator but at price level.
study(title="[RS]RSIC - Oscilator Bands V0", shorttitle="[RS]RSIC.V0", overlay=true)
lenght = input(3)
margin = input(4)

tf = margin
mp = (0.0001 * close) * margin

ph = avg(high, high[tf])
ph2 = wma((ph+mp)+(high-hl2), lenght*3)
pl = avg(low, low[tf])
pl2 = wma((pl-mp)-(low-hl2), lenght*3)

ma1 = alma((
    close >= ph[1] ? high + high - ph + mp :
    close <= pl[1] ? low - low + pl - mp :
    hlc3), lenght, 0.55, 6)

pu = plot(ph2, style=cross, color=silver, linewidth=0)
pd = plot(pl2,style=cross, color=silver, linewidth=0)
pc = plot(ma1, style=line, color=silver, linewidth=1)

fill(pu,pc, color=red, transp=80)
fill(pd,pc, color=green, transp=80)
Ideas Scripts Chart
United States
United Kingdom
Home Stock Screener Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Account and Billing Sign Out