Thanks for your reply.
I will answer your question however please help us keep the forum organized by creating a new topic when your question(s) no longer relates to the current topic, in this case, "Doing a calculation within N bars where N is an user"
How to check if today's Sunday? You can generate the code for this in the Strategy Builder by left side Time>Date series (Bars ago of 0), Equals, right side Time>Day of week> Sunday.
The code generated would be: if (Times[0][0].DayOfWeek == DayOfWeek.Sunday)
The code is asking the question is the date of the current bar equal to Sunday.
Comment