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
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。