When time to maturity tends to 0, like on expiry day, denominator $\sqrt t$ in becomes 0 and the first term in the formula becomes large enough to make theta of the contract more than its premium. How should this condition be dealt?
It is true that it is common that BS theta exceeds the actual market value of an option if the time to expiry is short.
- Therefore most systems compute theta via finite difference (FD) as a true 1 day bump and reprice theta (shifting the evaluation date one day forward and repricing).
- An additional benefit is that holdidays and weekends can easily be included in the computation (Friday will be a 3 day theta, provided Monday is a working day).
I am using Julia to demonstrate this in an answer to a similar question found here.
A more detailed example demonstrating that Bloomberg's OVML uses this logic and how it compares to quantlib can be found in this answer.