You could create a simple indicator that creates a "week" counter since the start of the data, by looking when the weekday number for today is less than yesterday (indicating a week has ended) and incrementing the counter.

Note that this will not work on markets that have holidays/trading breaks) over 1 week long but that's pretty much unheard of the western world (Sep 11 halted trading for a week, so this formula works for that). If your market has more than 1 week you'd need to use something like DateTimeDiff for ultimate accuracy.