One remark - due to irregular holidays, a week has no fixed number of bars. Therefore you must synchronize the time frame with the start of the week. In the manual there's an example for synchronizing it to a day.