IamTheDudeMan

5 Day Average Daily Range

Simple 5 day average range, adjust to true price movement rather than fixed levels.

-Enjoy

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?
//Created by Rob Olson 7.14.2014
//Average Daily Range Levels - 5 day

study(title="F0_ADR5", shorttitle="F0_ADR5", overlay=true) 

tsp=input(95,title="ADR Fill Transparency Level",type=integer)


dayHigh=security(tickerid, 'D', high[0]) 
dayLow=security(tickerid, 'D', low[0]) 

//ADR Levels
dayrange=(high - low)

r1 = security(tickerid, 'D', dayrange[1]) 
r2 = security(tickerid, 'D', dayrange[2]) 
r3 = security(tickerid, 'D', dayrange[3]) 
r4= security(tickerid, 'D', dayrange[4])
r5= security(tickerid, 'D', dayrange[5])

//get average daily range of prior 5 days
adr_5 = (r1+r2+r3+r4+r5) /5


//plot the adr levels
adrhigh=plot((dayLow+adr_5) , title="ADR High",style=line,color=navy,linewidth=2) 
adrlow=plot((dayHigh-adr_5), title="ADR LOW",style=line, color=aqua,linewidth=2)

fill(adrlow,adrhigh,color=aqua,transp=tsp)