Hello,
I'm looking to develop a function that gets the previous trading day function. The function GetDay() will get today's day number (ex. 172). However, GetDay()-1 won't necessarily get the previous trading day. For example, if today is Sunday, GetDay()-1 will return the number for Saturday and not Friday. I've attached an example where the day numbers are labeled.
Requirements:
Thank you
I'm looking to develop a function that gets the previous trading day function. The function GetDay() will get today's day number (ex. 172). However, GetDay()-1 won't necessarily get the previous trading day. For example, if today is Sunday, GetDay()-1 will return the number for Saturday and not Friday. I've attached an example where the day numbers are labeled.
Requirements:
- the function should get the previous trading day, regardless of the distance between days. For example, if there's a 3 day weekend, the function should account for that.
- the function should be not be based on hard coded values. For example, it can't say "if !GetDay() then if !GetDay()-1 else if !GetDay()-2 else..."
Thank you