Monday, April 11, 2011

Moving average of only one day of the week

Moving average of only one day of the week
Often we get requests for a formula that would take only one day per week and average weeks. For example the construction of moving averages only Friday. This can be done in MetaStock ™ for Windows using the following formula.
The following formula for MetaStock moving average Friday of each week, if you want to calculate on any other day would be replaced with 1 for Monday, 2 for Tuesday, 3 for Wednesday, 4 and Thursday. The number of day you want to replace the two 5 is already in the formula. This moving average is now 6 week or 6 Friday moving average. If you wanted to change the other points that will change the 30 number of specific days or weeks multiplied by 5. In other words, if you wanted 4th day moving average as of today will change 30-4 * 5 or 20th
Mov (If (DayOfWeek () = 5, C, Peak (1, If (DayOfWeek () = 5, C, 0), 1)), 30, M)

No comments:

Post a Comment

Powered by Blogger.