Script to calculate Average Daily Range? - page 2

 

#MTF_Average Range.mq4

how do i open this file???

thank you in advance.

isaac

 
yitz182003:
how do i open this file???

thank you in advance.

isaac

Don't you just attach it to a chart in Meta Trader 4?

 

Igor daily average

Hi all

Somewhere in this forum, IGOR wrote this definition of the daily range:

Ok first how does this indicator work?: the indicator calculates the previous daily range. It takes the High minus the Low (Yesterday High - Yesterday Low). Then it does the very same for the last 5 previous days. It does that for each seperate day and then makes an average of those 5 days. Then it does the same for the last 10 previous days. And as last it does the same for the last 20 previous days. Of those 4 results it makes a new average. It calculates the averages as a exponential moving average ....

Attached please find an indicator giving this definition. But, the problem is it gives only the data for the last day. If somebody can help to modify it to produce historical data in order to use it for historical testing.

Zeinoun

Files:
 

Hi,

I just posted something similar in another thread.

Originally Posted by trading801

so for just a simple indicator of average daily range,

the average true range will do ya?

Hi there,

As you can see in the pic below, the ATR reads 135 for today (this is eurusd) but for the daily average, the indic reads 156. You can see, however, that the "high to low" also indicates 135. So if you're looking for the "high to low", ATR will do the trick. Just remember it's isn't the same as the Daily Average.

Hope this helps,

Ms_Mel

 

just what i've been looking for!

Hi,

Is the Igor zeinoun meant is Igrok's Igor? the one who uses average daily range in his system & famous book Beating the Odds... I've been re-reading his book for the n-th times & I can't find the formula for his average daily range!

So thank you guys!

 
cameofx:
Hi,

Is the Igor zeinoun meant is Igrok's Igor? the one who uses average daily range in his system & famous book Beating the Odds... I've been re-reading his book for the n-th times & I can't find the formula for his average daily range!

So thank you guys!

you r welcome. I really do nt know if he is the same Igor. I read also his book. The important is that mq4 posted above give u an Idea what is the expected performance of any given currency any day. Many setups could be built upon. what is missing is the historical data. I will maybe use spreadsheet to do so or if anybodu could help modifying the above mq4.

 
cameofx:
Hi,

Is the Igor zeinoun meant is Igrok's Igor? the one who uses average daily range in his system & famous book Beating the Odds... I've been re-reading his book for the n-th times & I can't find the formula for his average daily range!

So thank you guys!
zeinoun:
you r welcome. I really do nt know if he is the same Igor. I read also his book. The important is that mq4 posted above give u an Idea what is the expected performance of any given currency any day. Many setups could be built upon. what is missing is the historical data. I will maybe use spreadsheet to do so or if anybodu could help modifying the above mq4.

I don't know if this will assist you any, (I'm still attempting to wrap my brain around a lot of this stuff ) but, try "http://forex-indicators.net/mt4-indicators".

This page gives alot of good MT4 indicators and shows you the MT4 code for them. Perhaps you can find the code that you are looking for to add to the EA.

I certainly hope this help's...

 

Average Daily Range (ADR) Indicator

zeinoun:
Hi all

Attached please find an indicator giving this definition. But, the problem is it gives only the data for the last day. If somebody can help to modify it to produce historical data in order to use it for historical testing.

Zeinoun

Here is the Average Range indicator that allows you to enter a fast and slow period. You need to put all three files in the correct locations and compile both mq4 files in that order:

HelpFunctions.mqh must be put in the include folder

HelpFunctions.mq4 must be put in the libraries folder and compiled

Average Range.mq4 must be put in the indicators folder and compiled

It calculates the average range (AR) in pips using the past N trading days. AR is the same as ADR (Average Daily Range) when the timeframe is set to PERIOD_D1. This function is written for code reusability so it can also be used for other timeframes as well.

You may also want to set the OptimizePerformance option to true. This limits the number of bars used for calculation to 400 by default (you can change this number to suit). Otherwise it would take a very long time to calculate the AR for all bars downloaded from the History Center.

My test results are consistent with the findings on this site: Most Volatile Active Traded Currency Pairs

In return please share your experience in using Average Range in your trading strategy.

Scott

 

I am missing StringArraySort.mqh

Apparelink can you post it here please?

 

Corrected errors in the determination of the date of the minimum and maximum rank.

Files:
Reason: