Nicolas

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
Daily ATR range for intraday chart

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: 411
Nicolas
Nicolas Legend
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

Seabiscuit
6 years ago
#

Hi! With the new PRT update, this indicator does not work anymore

julien1978
6 years ago
#

Hello Nicolas, this topic is a bit old but the problem of this indicator has never been addressed. The ADR value that is plotted intraday does not match the value of the regular ATR indicator of the daily timeframe (for the same period of course). Example: The ATR (20) value of the daily chart of the EURUSD is currently 105 today and was 108 last friday. But this indicator is calculating a 89,7 ADR. Is there a way to fix this? Any help would be appreciated.

Fab666
6 years ago
#

I've tried to get a fix for this also but no luck, it doesn't print the correct data as far as I've tested. A shame as its a very important factor. Ideally a daily/weekly/monthly ATR self adjusting would be very useful, but I'm no coder

Fab666
7 years ago
#

Fab666
7 years ago
#

Fab666
7 years ago
#

Fab666
7 years ago
#

Hi Nicolas I was the person who asked for this code to be made a couple years back, I stopped using it once It wasn't matching the default PRT 20day number that the below chart indicator produces, I was wondering if you every updated it with a fix? The code I have for this is attached, would appreciate your feedback thanks 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

julien1978
6 years ago
#

The ADR value that is plotted intraday does not match the value of the regular ATR indicator of the daily timeframe (for the same period of course). Example: The ATR (20) value of the daily chart of the EURUSD is currently 105 today and was 108 last friday. But this indicator is calculating a 89,7 ADR. Is there a way to fix this? Any help would be appreciated.

Nicolas
7 years ago
#

Try with this modification: for i = 0 to ATRperiod-1

igoren
7 years ago
#

Dear Nicolas et all, why do bodies and wicks in MT4 and PRT are different? what time setting I shud use to sync them, pls?

Nicolas
7 years ago
#

I don't know, depends of your broker timezone.

marcara
7 years ago
#

Thanks Nicolas. It it working great! It is what I was lokking for! Many thanks! Is it possible to recde it in order to have it as an standalone indicator? As It is in the normal ATR .. soIt will be psssible o have historicata, averages and so on,.. Many thanks

Nicolas
7 years ago
#

Change the last line to RETURN htr,ltr

Nbrfx
8 years ago
#

how can i use this indicator on Mt4 ?

Nicolas
8 years ago
#

Our website does not provide indicators for MT4, we are using ProRealTime trading platform: www.prorealtime.com . If you want some of them to be converted, you ask for private paid assistance to our programming services: https://www.prorealcode.com/trading-programming-services/

crolakstrading
9 years ago
#

what can i do to change this in to the right daily ATR? is it something to do with the timezone?

crolakstrading
9 years ago
#

at least 20pips difference pretty much all the markets!!!!

crolakstrading
9 years ago
#

hi Nicolas.. please is there's a way to fix this? what am i doing wrong? iis everyone else get the right daily ART shown as the indicator??? when i change the ATR period to 7 on the indicator.. that will come a bit closer to daily 14 period ATR!!!!

Nicolas
9 years ago
#

Yes, but that's a translation of the original code someone asked in forums.

crolakstrading
9 years ago
#

sorry i meant the indicator would NOT show any lines if threre’s not enough sufficient bars displayed .. so 15mins i use minimum 1000 units..

crolakstrading
9 years ago
#

Hi Nicolas, this is used as a bouncing off strategy… lets say the market open of the candle and bounce off from daily ATR!!! not sure why it doesn’t match the Daily ATR indicator on prorealtime? Example: on the FTSE my indicator Daily ATR 14 period says 92.548 but your one says D1atr:138.9 ?? any reason why? please help??

crolakstrading
9 years ago
#

the indicator would show any lines if threre's not enough sufficient bars displayed .. so 15mins i use minimum 1000 units.. i have tried even 1month but get the same results?? not sure why???

Nicolas
9 years ago
#

Be sure to have sufficient bars displayed on your chart for the indicator to compute correctly.

crolakstrading
9 years ago
#

hi Nicolas, yes i have change the in this indicator time to 14 and also tried with 20 and im using this indicator on the 15min chart.. but either 14 period or 20 period doesnt match the normal daily ATR period 14 or 20? EX: today FTSE - daily ATR = 88.49 and the indicator shows as D1atr 132.9 EURJPY Daily ATR (14)= 127.6 and the indicator(14) 102.4 GBPUSD daily ATR =133.1 and indicator D1atr = 118.33

Nicolas
9 years ago
#

Did you change the period to 14 in this indicator too? Are you using customized timezone for FTSE?

pseven5
9 years ago
#

Could anyone please help me install this. I am adding it via the wrench but it just appears greyed out and doesn't display. Thanks

Nicolas
9 years ago
#

What timeframe? Be sure to add sufficient xx Bars displayd for the indicator to compute correctly.

DanT01
9 years ago
#

Hi Nicolas, Thanks very much for uploading this, works great. Is there a way to turn this into a scanner? I am basically after getting an alert when something breaks through the ATR indicator level but I am not sure how to set that up. Thanks Dan

Nicolas
9 years ago
#

Please add new request in the appropriate forum. You can also use the assisted creation in the platform. Firstly, you'll have to add the high end low ATR levels in the RETURN instruction.

darraghcoyle@
9 years ago
#

got it sorted thanks

ProRealCode ProRealCode
Loading...