DaysToExpiration (Function)
The DaysToExpiration function returns the number of days left until a specified option expiration date. The calculation is based on the third Friday of every month, which means it's not designed for most commodities, and commodities options.
Syntax
DaysToExpiration(ExpMonth,ExpYear)
Returns (Integer)
A numeric value for the current bar, containing the number of days until the stock option expires from the current date. This function will return a negative number from the expiration date if the expiration date has already occurred.
Parameters
Name | Type | Description |
ExpMonth | Numeric | Sets the target month, entered as a number; 1 = January, 2 = February, and so on. |
ExpYear | Numeric | Sets the target year, entered in the format YYY; 99 = 1999, 100 = 2000, 101 = 2001, 102 = 2002, and so on. |
Examples
Assigns to Value1 the number of days until the stock option expires in December from today:
Value1 = DaysToExpiration (12,102);