## High Low Range Average

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.

### High Low Range Average

Based on request.
viewtopic.php?f=27&t=70226
High Low Range Average.lua

Apprentice
FXCodeBase: Confirmed User

Posts: 26559
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

### Re: High Low Range Average

Thank you .. but it is not what I am looking for
Please let me know if the above request is not clear

Posts: 32
Joined: Tue Jun 02, 2020 12:06 am

### Re: High Low Range Average

We have two lines, averages of
1) high - open
2) open - low

Can you specify the equation?

Apprentice
FXCodeBase: Confirmed User

Posts: 26559
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

### Re: High Low Range Average

Can you please check the attached sheet and let me know .. it's a sample

I need the two averages to be displayed on chart .. no lines or oscillator
Attachments
EUR-USD.xlsx

Posts: 32
Joined: Tue Jun 02, 2020 12:06 am

### Re: High Low Range Average

As numbers only?

Apprentice
FXCodeBase: Confirmed User

Posts: 26559
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

### Re: High Low Range Average

yes .. only the numbers (in pips)

Posts: 32
Joined: Tue Jun 02, 2020 12:06 am

### Re: High Low Range Average

Apprentice
FXCodeBase: Confirmed User

Posts: 26559
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

### Re: High Low Range Average

Thank you Apprentice .. this is good .. nice and simple as desired

But can you please double check the calculation as I am getting different results on excel

let me break it down once more

The difference (in pips) between open price & highest price
The difference (in pips) between open price & lowest price
then calculate the average of the above two values for N number of periods EXCLUDING the current candle

Please let me know if more details needed.

Regards

Posts: 32
Joined: Tue Jun 02, 2020 12:06 am

### Re: High Low Range Average

high[period]= source.high[period]-source.open[period];
low[period]= source.open[period]-source.low[period];

High[period]= mathex.avg(high,period-Period+1, period);
Low[period]= mathex.avg(low,period-Period+1, period);

Apprentice
FXCodeBase: Confirmed User

Posts: 26559
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

### Re: High Low Range Average

OK .. i will double check at my side

But is it possible to get the standard deviation as well .. same thing but instead of average .. calculate the standard deviation.

Thanks