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
Average Daily Range Calculation question [SOLVED]
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: Average Daily Range Calculation question
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.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 ?
Re: Average Daily Range Calculation question
The solution you gave will work but is there a simple way to get a specific day High/low ?
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: Average Daily Range Calculation question [SOLVED]
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.The solution you gave will work but is there a simple way to get a specific day High/low ?
I'm not sure how to make it more simpler than referring to an example.
Re: Average Daily Range Calculation question
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
I want to calculate the average range during the last 2/3 months.
How can I get this data ?
Thank you
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2958 times
Re: Average Daily Range Calculation question
jorsde, have you tried using the prebuilt HighD, LowD functions?
Re: Average Daily Range Calculation question
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
Thank you