Dua Yong Rew :
Hi all,
I need to get the hourly range High - Low of a day and over x days.
I written a sample to get daily range, how do I modify to get hourly range for a day and over x days?
Use the barshift function to get information about a specific bar
- Dua Yong Rew: I written a sample to get daily range, how do I modify to get hourly range for a day and over x days?
Why not just call iATR?
- Dua Yong Rew: I need to get the hourly range High - Low of a day and over x days.
That you have to code yourself.
Not tested, not compiled, just typed.
double ave_range_hour(int count, int hour){ datetime when = date() + hour*PeriodSeconds(PERIOD_H1); double sum=0; int n=0; while(n < count){ int iBar=iBarShift(_Symbol, PERIOD_H1, when, true); if(iBar >= 0)){ sum += iHigh(_Symbol, PERIOD_H1, iBar) - iLow(_Symbol, PERIOD_H1, iBar); ++n; } when -= PeriodSeconds(PERIOD_D1); } return sum / count; }
Not tested, not compiled, just typed.
William Roeder #:
-
Why not just call iATR?
-
That you have to code yourself.
Not tested, not compiled, just typed.
Not tested, not compiled, just typed.
I am also trying to find the same indicator.
Files:
ADR.png
78 kb

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi all,
I need to get the hourly range High - Low of a day and over x days.
I written a sample to get daily range, how do I modify to get hourly range for a day and over x days?