OPEN-SOURCE SCRIPT
NIFTY, SENSEX AND BANKNIFTY Options Expiry Marker

NSE Options Expiry Background Marker
Category: Date/Time Indicators
Timeframe: Daily
Markets: NSE (India) / Any Exchange
Description
Automatically highlights weekly and monthly options expiry days for NIFTY, BANKNIFTY, and SENSEX using color-coded background shading. Works across entire chart history with customizable transparency levels.
Key Features
Use Cases
Technical Details
Category: Date/Time Indicators
Timeframe: Daily
Markets: NSE (India) / Any Exchange
Description
Automatically highlights weekly and monthly options expiry days for NIFTY, BANKNIFTY, and SENSEX using color-coded background shading. Works across entire chart history with customizable transparency levels.
Key Features
- ✅ Background Highlighting - Non-intrusive color shading on expiry days
- ✅ Multi-Index Support - NIFTY, BANKNIFTY, and SENSEX simultaneously
- ✅ Weekly & Monthly Expiry - Different transparency levels for easy distinction
- ✅ Customizable Expiry Days - Set any weekday (Mon-Fri) as expiry day
- ✅ Adjustable Transparency - Separate controls for weekly and monthly expiries
- ✅ Full Historical Data - Works on all visible bars across years
- ✅ Smart Monthly Detection - Automatically identifies last occurrence in month
- ✅ Color Coded - Blue (NIFTY), Red (BANKNIFTY), Green (SENSEX)
Use Cases
- Options trading strategy planning
- Identify expiry day volatility patterns
- Visual reference for monthly vs weekly cycles
- Backtest strategies around expiry days
- Track multiple index expiries on single chart
Technical Details
- Uses India timezone (GMT+5:30) for accurate date calculations
- Handles leap years automatically
- Smart algorithm identifies last weekday occurrence per month
- Works seamlessly on any chart timeframe (optimized for Daily)
- No performance impact - simple background coloring
Skrip open-source
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Pernyataan Penyangkalan
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Skrip open-source
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Pernyataan Penyangkalan
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.