Days to Expiry

What is Days to Expiry?
The Days to Expiry feature calculates the number of trading days remaining until the selected expiry date.
This is useful for options and futures trading strategies that rely on expiry-based conditions.
How is Days to Expiry Calculated?
- The system subtracts the current date (or running date in backtests) from the selected expiry date.
- Market holidays are excluded, ensuring an accurate count of actual trading days left.
- This value can be used in conditions or indicators to adjust trading strategies based on time to expiry.
For example, if today is Monday, February 5th, and the nearest expiry is Thursday, February 8th,
the Days to Expiry value will be 3 (excluding any holidays).
Selecting the Expiry Date
Users can select an expiry date based on available contracts for Futures and Options:
1. Expiry Type
- Weekly Expiry – Selects weekly options expiry (typically Thursdays).
- Monthly Expiry – Selects monthly expiry (last Thursday of the month).
2. Expiry Number
- Current Expiry (1st) – The nearest available expiry contract.
- Next Expiry (2nd, 3rd, etc.) – The following expiries after the nearest one.
Example: If today is February 5th, and the next three available expiries for BANKNIFTY are:
- February 8th (Current)
- February 15th (Next)
- February 22nd (Next+1) Selecting "Next+1" will set the expiry date to February 22nd.
Element Name
Each Days to Expiry selection is assigned a unique Element Name that is automatically set based on the expiry and underlying symbol selection.
However, users can rename the element for better organization and readability within their strategy.
What is the Element Name?
The Element Name is a unique identifier for the Days to Expiry data point.
It helps the system recognize and use the expiry-based value in strategy execution.
Users can customize it for clarity in complex strategies.
Use Cases for Days to Expiry
- Expiry-based trading strategies
→ Example: Exit trades when Days to Expiry ≤ 2. - Options trading adjustments
→ Example: Adjust position sizing as expiry approaches. - Futures rollovers
→ Example: Switch positions before the next contract expiry.
Ensure the correct expiry selection for weekly vs. monthly options and futures.
Using the wrong expiry type can lead to unintended trade execution.
Next Steps
✅ Add Days to Expiry in your strategy
✅ Use expiry-based conditions for options or futures trading
✅ Adjust trades dynamically as expiry nears