Hi Nicholas and all.
I have written a code snippet for retrieving the 7hr ATR on a 1 min TF, the same program is used throughout my trading and hence used on different TF’s, however now that the ATR snippet has been added it fails to work on the daily TF …for obvious reasons..
My question is…with the use of a variable, do you think it would be possible to have the snippet turned off by default?
I hope that makes sense, I have attached the snippet.
TIA
RR
defparam drawonlastbaronly=true
defparam calculateonlastbars=6000
if time=93000 then
US=open
endif
atrmid=us
if close>atrmid then
H4ext=atrmid+(aatr*2)
DRAWtext("---------------H4ext",barindex[0],H4ext,dialog,bold,13)coloured (0,255,255)
H3ext=atrmid+(aatr*1.5)
DRAWtext("---------------H3ext",barindex[0],H3ext,dialog,bold,13)coloured (0,255,255)
H2ext=atrmid+(aatr)
DRAWtext("---------------H2ext",barindex[0],H2ext,dialog,bold,13)coloured (0,255,255)
Hfull=atrmid+(aatr/2)
DRAWtext("---------------Hfull",barindex[0],Hfull,dialog,bold,13)coloured (0,255,255)
endif
Hhalf=atrmid+(aatr/4)
DRAWtext("---------------Hhalf",barindex[0],Hhalf,dialog,bold,13)coloured (0,255,255)
atrmid=atrmid
DRAWtext("---------------atrMID",barindex[0],atrmid,dialog,bold,13)coloured (0,255,255)
Lhalf=atrmid[0]-(aatr/4)
DRAWtext("---------------L",barindex[0],Lhalf,dialog,bold,13)coloured (0,255,255)
if close<atrmid then
L1=atrmid-(aatr/2)
DRAWtext("--------------L1",barindex[0],L1,dialog,bold,13)coloured (0,255,255)
Lfull=atrmid-(aatr)
DRAWtext("--------------L1",barindex[0],L1,dialog,bold,13)coloured (0,255,255)
L2ext=atrmid[0]-(aatr*1.5)
DRAWtext("---------------Lfull",barindex[0],Lfull,dialog,bold,13)coloured (0,255,255)
endif
timeframe(7 hours,default)
aatr=AverageTrueRange[14](close)
return close