vladrac: but cant figure out how would I compute only the average of Mondays, Tuesdays, etc.
Not compiled, not tested.
double TodaysDailyRange(int length=14){ int dow = DayOfWeek(); int count=0; double sum=0; for(int iD1 = 1; count < length; ++iD1){ datetime when = iTime(_Symbol, PERIOD_D1, iD1); if( TimeDayOfWeek(when) != dow) continue; sum += iHigh(_Symbol, PERIOD_D1, iD1) - iLow(_Symbol, PERIOD_D1, iD1); ++count; } return sum / length; }Not compiled, not tested.

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
hello Forum,
Im trying to figure out how to calculate the average daily move of a pair in a particular day of the week.
I do have a code that can calculate the average of X number of days, or the last day , but cant figure out how would I compute only the average of Mondays, Tuesdays, etc.
appreciate your help.
Regards,
Vladimir