Page 1 of 5

Average Daily Range (ADR) Projection

PostPosted: Thu Nov 25, 2010 7:30 am
by Apprentice
ADR Projection.png


ADR Projections Up = low[period] + ADR[period];
ADR Projections Down = high[period] - ADR[period];

Daily Range
DR = High[period] - Low [Period];
ADR = AVG ( DR, Period);
ATR is also supported, but is basically the same as ATR.

ADR Projection.lua
(6.13 KiB) Downloaded 3887 times



Multi Time Frame Version.
Allows selection of Time Frame
MTF ADR Projection.lua
(10.63 KiB) Downloaded 3184 times

MT4/MQ4 version.
viewtopic.php?f=38&t=66195

Re: Average Daily Range (ADR) Projection

PostPosted: Thu Sep 01, 2011 5:25 pm
by luigifx
Thanks a lot for your work apprentice !

This is a great indicator but I would like, instead of a line, have a zone called "confidence interval" around the ADR line.
By example for a confidence interval of 68% : [ADR-(SD/squareroot(N)) ; ADR-(SD/squareroot(N))]
where SD = Standard deviation on the period
and N = number of period
http://fr.wikipedia.org/wiki/Intervalle_de_confiance this link is in french but you can see formula in example 1
here is the link in english : http://en.wikipedia.org/wiki/Confidence_interval

I would like to use this indicator on MTF ADR Projection and :
. be able to chose which confidence interval to set
. show the ADR line or not
.set up the color of upward and downward zone (as we already have in marketscope for the box draw)
.set up the color of line (as we already have in marketscope for the box draw)

Please tell me if you can develop this indicator
Thanks

Re: Average Daily Range (ADR) Projection

PostPosted: Tue Sep 13, 2011 8:00 am
by a1afx1111
I downloaded the indicator and all I got on the chart was two green lines.
How do I get the text that is shown in your screen shot?

Re: Average Daily Range (ADR) Projection

PostPosted: Tue Sep 13, 2011 8:14 am
by sunshine
Please try to move chart "in future" to see the text. For me this works.

Re: Average Daily Range (ADR) Projection

PostPosted: Wed Sep 14, 2011 4:41 pm
by emjay-short
The MTF version is nice. Thanks. :)
Showing Daily Range projection on a 15m chart.

Re: Average Daily Range (ADR) Projection

PostPosted: Mon Oct 24, 2011 7:33 am
by sabrumea
is it possible to add an option to display it historically???

Re: Average Daily Range (ADR) Projection

PostPosted: Mon Oct 24, 2011 4:40 pm
by Apprentice
Your request is added to the developmental cue.

Re: Average Daily Range (ADR) Projection

PostPosted: Sat Oct 29, 2011 12:56 pm
by sabrumea
thank you Apprentice, looking forward to have it. it is very useful indicator!

Re: Average Daily Range (ADR) Projection

PostPosted: Sat Oct 29, 2011 1:08 pm
by sabrumea
Apprentice, sorry once you will do the historical option could you also fix the font of the text to make it a bit smaller? i was trying to do that myself but can not understand where is it in the code :(

Re: Average Daily Range (ADR) Projection

PostPosted: Sat Oct 29, 2011 1:46 pm
by sabrumea
Apprentice,

i have created font

Code: Select all
local font;
function Prepare() 
   ...
   font = core.host:execute("createFont", "Verdana", 10, false, false);   
   ...


how should i call it now in the DrawLable1 function??
Code: Select all
if TR[1] >TR[2] then
            core.host:execute ("drawLabel", 1, source:date(source:size()-1) + 3*size , MAX + 2*(MAX-MIN)/5, "TR "..tostring( round( TR[1]* M,0)).. " (+)" );
            elseif  TR[1] < TR[2] then
            core.host:execute ("drawLabel", 1, source:date(source:size()-1) + 3*size , MAX + 2*(MAX-MIN)/5, "TR "..tostring( round( TR[1]* M,0)) .." (-)" );
            else
            core.host:execute ("drawLabel", 1, source:date(source:size()-1) + 3*size , MAX + 2*(MAX-MIN)/5, "TR "..tostring( round( TR[1]* M,0)) .." (0)" );
            end