CapnOscar

RMATrix

Just Another Help For Trend.. Dont ask me how it works.. 10110110 ?
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?
//Coded by CapnOscar on 16.04.2015 - Say Thanks? 
study(title="RMATrix" , shorttitle="RMATrix" )

UpTrend = input(52, minval=50, title="Uptrend" )
DownTrend = input(48, maxval=50, title="DownTrend" )

//Define The Lines 
bandmax = hline(100)
bandhi = hline(0)

//MicroTrend
src0 = close, len0 = input(5, minval=1, title="TinyTrend" )
up0 = rma(max(change(src0), 0), len0)
down0 = rma(-min(change(src0), 0), len0)
rsi0 = down0 == 0 ? 100 : up0 == 0 ? 0 : 100 - (100 / (1 + up0 / down0))
//PlaceTiny
smrsi0 = rsi0 >= 0 ? 80 : na
//ColorMajorRSI
tinyc0 = rsi0 > UpTrend ? green : rsi0 < DownTrend ? red : orange
plotshape(smrsi0, style=shape.labelup, location=location.absolute, text='o', color=tinyc0, textcolor=tinyc0)



//TinyTrend
src = close, len = input(7, minval=1, title="MiniTrend" )
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))
//PlaceTiny
smrsi = rsi >= 0 ? 60 : na
//ColorMajorRSI
tinyc = rsi > UpTrend ? green : rsi < DownTrend ? red : orange
plotshape(smrsi, style=shape.labelup, location=location.absolute, text='o', color=tinyc, textcolor=tinyc)

//MiniTrend
src2 = close, len2 = input(21, minval=1, title="Trend" )
up2 = rma(max(change(src2), 0), len2)
down2 = rma(-min(change(src2), 0), len2)
rsi2 = down2 == 0 ? 100 : up2 == 0 ? 0 : 100 - (100 / (1 + up2 / down2))
//PlaceTiny
smrsi2 = rsi2 >= 0 ? 40 : na
//ColorMajorRSI
tinyc2 = rsi2 > UpTrend ? green : rsi2 < DownTrend ? red : orange
plotshape(smrsi2, style=shape.labelup, location=location.absolute, text='o', color=tinyc2, textcolor=tinyc2)


//MajorTrend
src3 = close, len3 = input(84, minval=1, title="MajorTrend" )
up3 = rma(max(change(src3), 0), len3)
down3 = rma(-min(change(src3), 0), len3)
rsi3 = down3 == 0 ? 100 : up3 == 0 ? 0 : 100 - (100 / (1 + up3 / down3))
//PlaceTiny
smrsi3 = rsi3 >= 0 ? 20 : na
//ColorMajorRSI
tinyc3 = rsi3 > UpTrend ? green : rsi2 < DownTrend ? red : orange
plotshape(smrsi3, style=shape.labelup, location=location.absolute, text='o', color=tinyc3, textcolor=tinyc3)