Hilega To Milega

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

//@version=4

// RSI WMA EMA @NKStockTalk1


// Hilega-Milega System

study(title="H-M system", overlay=false)


src = input(close, type=input.source, title="Source")

len = input(9, minval=1, title="RSI")


up = rma(max(change(src), 0), len)
down = rma(-min(change(src), 0), len)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))

wmaLength = input(21, title="WMA")


emaLength = input(3, title="EMA")

wma = wma(rsi, wmaLength)


ema = ema(rsi, emaLength)

plot(rsi, color=color.black, linewidth=1, title="RSI", transp=0)


plot(wma, color=color.red, linewidth=2, title="WMA", transp=0)
plot(ema, color=color.green, linewidth=1, title="EMA")

hline = hline(50, color=#b2b5be, linestyle=hline.style_dashed, title="Middle")


ref = plot(50, editable=true, title="50 Line")
obsd = plot(rsi>50? rsi : 50, transp=100, editable=false, title="oversold",
display=display.none)
obbt = plot(rsi>50? 50 : rsi, transp=100, editable=false, title="overbought",
display=display.none)
fill(obsd,ref, color=color.red, transp=90, title="Overbough")
fill(obbt,ref, color=color.blue, transp=90, title="Oversold")

//thanks NITISHSIR

You might also like