In this example, weekly_ema was computed after setting the time scale to weekly. Then the daily time scale was restored and a synchronize was performed. It seems that the above code would work fine if every week had 5 market days in it. But with market holidays, that is not the case and so it would seem that the above code does not do precisely what I want it to do. Is there a standard way to compare weekly data for one week with the weekly data for the previous week when one is in a for loop on a daily time frame? Otherwise, I've been trying to come up with various kludges that might work.

We sent an Verification
Code to your email address. If you don't receive this code within the next 5 minutes.
Please click here to
request a new code.
New Verification Code sent. Please check your Inbox.Please enter your Email to receive a new Verification Code