Are there any ideas?
Use the DayOfWeek property of the .NET Datetime class.
Do I have to implement a special handling for holidays? Do you have an idea how to implemet it in an easy way?
For historical backtest purposes you could peek ahead one bar, if the DayOfWeek of bar N plus one is less than that of bar N then you know bar N is the last day of the week. If you want the balancing to occur at end of week you’d need to compare DayOfWeek of bar N + 1 with that of bar N + 2.
Your Response Post
Login is required