Daily ATR range for intraday chart

Category: Indicators By: Nicolas Created: February 3, 2017, 8:49 AM
February 3, 2017, 8:49 AM
Indicators
44 Comments

This indicator display graphically on any intraday chart, the daily Average True Range of the last 20 periods (periods can be modified in the indicator parameter of course) added or substract respectively to the current daily low and the daily high.

An upper and a lower line display these 2 values. I don’t know exactly how it is supposed to be traded, but I think it should be used as breakout of levels or bouncing trades.

This indicator seems to be known as “LEDGE ATR” and has been requested to be converted from MT4 version in our English forums (link in the indicator code).

//PRC_Daily ATR range intraday | indicator
//03.02.2017
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//https://www.prorealcode.com/topic/showing-customized-daily-indicators-in-smaller-timeframes/

defparam drawonlastbaronly=true

// --- parameters
//ATRperiod = 20
// ---

dTR = 0
for i = 0 to ATRperiod
 dTR=dTR+max(abs(Dhigh(i)-Dlow(i)),max(abs(Dhigh(i)-Dclose(i+1)),abs(Dlow(i)-Dclose(i+1))))
next

avg = dTR/ATRperiod
converted = round(avg/pointsize*10)/10

htr = Dlow(0)+avg[1]
ltr = Dhigh(0)-avg[1]

if intradaybarindex=0 then
 begin=barindex
endif

drawsegment(begin,htr,barindex,htr) coloured(200,100,0)
drawtext("#htr# - (D1atr: #converted#)",barindex,htr+10*pointsize,Dialog,Bold,10) coloured(200,100,0)
drawsegment(begin,ltr,barindex,ltr) coloured(200,100,0)
drawtext("#ltr# - (D1atr: #converted#)",barindex,ltr-10*pointsize,Dialog,Bold,10) coloured(200,100,0)

return

Download
Filename: PRC_Daily-ATR-range-intraday.itf
Downloads: 407
Nicolas Master
I created ProRealCode because I believe in the power of shared knowledge. I spend my time coding new tools and helping members solve complex problems. If you are stuck on a code or need a fresh perspective on a strategy, I am always willing to help. Welcome to the community!
Author’s Profile

Comments

Logo Logo
Loading...