Average Daily Range (ADR) Projection

Here you can post and download custom indicators. PLEASE: Do not start topics unless you are posting your own indicator, they will be moved to appropriate section even if you do.

Moderator: admin

Average Daily Range (ADR) Projection

Postby Apprentice » Thu Nov 25, 2010 7:30 am

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 3181 times



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

MT4/MQ4 version.
viewtopic.php?f=38&t=66195
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 19245
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Average Daily Range (ADR) Projection

Postby luigifx » Thu Sep 01, 2011 5:25 pm

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
luigifx
 
Posts: 10
Joined: Tue Jun 14, 2011 2:11 pm

Re: Average Daily Range (ADR) Projection

Postby a1afx1111 » Tue Sep 13, 2011 8:00 am

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?
a1afx1111
 
Posts: 2
Joined: Tue Sep 13, 2011 7:49 am

Re: Average Daily Range (ADR) Projection

Postby sunshine » Tue Sep 13, 2011 8:14 am

Please try to move chart "in future" to see the text. For me this works.
sunshine
 

Re: Average Daily Range (ADR) Projection

Postby emjay-short » Wed Sep 14, 2011 4:41 pm

The MTF version is nice. Thanks. :)
Showing Daily Range projection on a 15m chart.
emjay-short
 
Posts: 34
Joined: Wed Mar 16, 2011 4:21 pm

Re: Average Daily Range (ADR) Projection

Postby sabrumea » Mon Oct 24, 2011 7:33 am

is it possible to add an option to display it historically???
User avatar
sabrumea
 
Posts: 34
Joined: Thu Aug 26, 2010 6:15 pm

Re: Average Daily Range (ADR) Projection

Postby Apprentice » Mon Oct 24, 2011 4:40 pm

Your request is added to the developmental cue.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 19245
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Average Daily Range (ADR) Projection

Postby sabrumea » Sat Oct 29, 2011 12:56 pm

thank you Apprentice, looking forward to have it. it is very useful indicator!
User avatar
sabrumea
 
Posts: 34
Joined: Thu Aug 26, 2010 6:15 pm

Re: Average Daily Range (ADR) Projection

Postby sabrumea » Sat Oct 29, 2011 1:08 pm

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 :(
User avatar
sabrumea
 
Posts: 34
Joined: Thu Aug 26, 2010 6:15 pm

Re: Average Daily Range (ADR) Projection

Postby sabrumea » Sat Oct 29, 2011 1:46 pm

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
User avatar
sabrumea
 
Posts: 34
Joined: Thu Aug 26, 2010 6:15 pm

Next

Return to Custom Indicators

Who is online

Users browsing this forum: Bing [Bot] and 23 guests