I am looking to code a ADR indicator that will display the Annual ADR excluding weekends.
The line of code I have at present is:
while(ExcludeSundayData && TimeDayOfWeek(iTime(Symbol(),PERIOD_D1,n))==0) n++; // If TimeDayOfWeek returns 0 add 1 to n to skip Sunday
This will skip Sunday but I want to have the ability to also skip Saturdays, I am not a fluent coder and have been gashing things together so far.
I have the ADR displayed and working on 365 so just want to be able to drop Saturday as well as sunday.
Any help appreciated.
Regards
Console
The line of code I have at present is:
while(ExcludeSundayData && TimeDayOfWeek(iTime(Symbol(),PERIOD_D1,n))==0) n++; // If TimeDayOfWeek returns 0 add 1 to n to skip Sunday
This will skip Sunday but I want to have the ability to also skip Saturdays, I am not a fluent coder and have been gashing things together so far.
I have the ADR displayed and working on 365 so just want to be able to drop Saturday as well as sunday.
Any help appreciated.
Regards
Console