TSR ADR Daily Range Display

Category: Indicators By: Nicolas Created: December 11, 2018, 12:02 PM
December 11, 2018, 12:02 PM
Indicators
9 Comments
TSR ADR Daily Range Display

This indicator plot rectangle of Average Day Range of different periods and therefore how far the market travels on average.

So the marked levels could be used as support / resistance levels or objectives.

The indicator uses 20 day average.

Converted from a MT4 indicator as requested in the ProBuilder english forum.

 

//PRC_TSR_DailyRange_display | indicator
//11.12.2018
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//translated from MT4 version

defparam drawonlastbaronly=true

if day<>day[1] then 
 startbar=barindex
 FIVE=0
 TEN=0
 TWENTY=0
 for i = 1 to 20 do
  if i<6 then
   FIVE=FIVE+(dhigh(i)-dlow(i))
  endif
  if i<11 then
   TEN=TEN+(dhigh(i)-dlow(i))
  endif
  TWENTY=TWENTY+(dhigh(i)-dlow(i))
 next
 FIVE = FIVE/10
 TEN = TEN/20
 TWENTY = TWENTY/40
 AV = (FIVE+TEN+TWENTY)/3
endif

HIDaily = dhigh(0)-(AV)
LOWDaily = dlow(0)+(AV)
HIDaily1 = dhigh(0)
LOWDaily1 =dlow(0)
HIDaily2 = dhigh(0)-(AV)*2
LOWDaily2 =dlow(0)+(AV)*2

drawrectangle(startbar,HiDaily,barindex,LOWDaily) coloured(128,0,0)
drawrectangle(startbar,HiDaily1,barindex,LOWDaily1) coloured(0,100,0)
drawrectangle(startbar,HiDaily2,barindex,LOWDaily2) coloured(0,44,9)
center=max(startbar+(barindex-startbar)/2,1)
drawtext("Top Daily Range",center,LowDaily2,Dialog,Bold,16) coloured(244,164,96)
drawtext("Bottom Daily Range",center,HiDaily2,Dialog,Bold,16) coloured(244,164,96)
drawtext("             High",barindex,dhigh(0),Dialog,Bold,16) coloured(154,205,50)
drawtext("             Low",barindex,dlow(0),Dialog,Bold,16) coloured(154,205,50)
drawtext("             Open",barindex,dopen(0),Dialog,Bold,16) coloured(244,164,96)
RETURN

 

Download
Filename: PRC_TSR_DailyRange_display.itf
Downloads: 430
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

Logo Logo
Loading...