Burnt Toast
New member
I'm trying to code an indicator that will tell me when to buy back a sold option. I've gotten close, but I'm having trouble with weekend days interfering with my calcs.
The part I'm having trouble with is :
plot DTE = GetDaysToExpiration();
I'd like to get the number of trading days until expiration not the above which uses calendar days. I've tried using CountTradingDays(x,y), but it only gives a constant and I need it to count down to 0 from the entry day each day until expiration day.
Edit: After thinking about it more I guess the simple question is:
How do I remove weekends and holidays from GetDaysToExpiration()?
The part I'm having trouble with is :
plot DTE = GetDaysToExpiration();
I'd like to get the number of trading days until expiration not the above which uses calendar days. I've tried using CountTradingDays(x,y), but it only gives a constant and I need it to count down to 0 from the entry day each day until expiration day.
Edit: After thinking about it more I guess the simple question is:
How do I remove weekends and holidays from GetDaysToExpiration()?
Last edited: