Page 1 of 1

Average Daily Range Calculation question

Posted: Apr 27 2014
by jorsde
Hi

I want to build a simple indicator that will calculate the average daily range (of the ~last 4 months) and plot it in the chart.
I want to write a simple function that will looks something like
Result = (Ī£(day's high - Day's low) ) / 88 (around 88 trading days)

However , I can't find how can I retrieve the daily high and low.
AFAIK using Bars.StatusLine.High ,Bars.High or AverageFC won't help because they retrieve the bars (not necessary the daily high or lows).


Is there a simple way to retrieve the day's high and low ?

Thank you

Re: Average Daily Range Calculation question

Posted: Apr 30 2014
by JoshM
However , I can't find how can I retrieve the daily high and low.
AFAIK using Bars.StatusLine.High ,Bars.High or AverageFC won't help because they retrieve the bars (not necessary the daily high or lows).

Is there a simple way to retrieve the day's high and low ?
You can store the daily high/low in a variable that keeps track of these values through out the day. I posted an example for that here.

Re: Average Daily Range Calculation question

Posted: May 01 2014
by jorsde
The solution you gave will work but is there a simple way to get a specific day High/low ?

Re: Average Daily Range Calculation question  [SOLVED]

Posted: May 01 2014
by JoshM
The solution you gave will work but is there a simple way to get a specific day High/low ?
Not that I'm aware of, unless there is some PowerLanguage .NET property that returns that specific value. Even in the simple PowerLanguage (default MultiCharts) you'll need to do the three things from that example.

I'm not sure how to make it more simpler than referring to an example.

Re: Average Daily Range Calculation question

Posted: May 02 2014
by jorsde
The code you've posted only checks the current session, however I want to calculate the high/low that was 2 days ago or 100 days ago.
I want to calculate the average range during the last 2/3 months.

How can I get this data ?

Thank you

Re: Average Daily Range Calculation question

Posted: May 13 2014
by Henry MultiŠ”harts
jorsde, have you tried using the prebuilt HighD, LowD functions?

Re: Average Daily Range Calculation question

Posted: May 13 2014
by jorsde
I've found a way to solve it as JoshM suggested but I think a simple function (or functions) which will retrieve this information will serve a lot of users because I can think of a lot of uses for it.

Thank you