Skip to content
All library documents

Trading Calendar for Holidays and Weekly Expiry Adjustments

Article TradingView scripts

Summary

This chart indicator displays monthly calendar tables that distinguish trading days, weekends, holidays, and designated expiry days. The user selects a weekday for expiry and can customize colors, table placement, and whether vertical lines mark expiry dates. The script requests daily chart data, groups dates into monthly calendars, and identifies the chosen expiry weekday, moving the displayed expiry to an earlier trading day when that weekday is absent from the trading-day sequence.

The indicator is a scheduling aid rather than a trading signal or tested strategy. It derives trading days from the chart’s daily data, so its holiday markings depend on the instrument’s data feed and exchange calendar; no external holiday source or validation process is described. Its selected expiry weekday is configurable, which means the output should be checked against the relevant contract’s actual expiry rules, especially where holidays alter schedules. The document provides implementation logic and visuals but no evidence that the calendar matches every market or instrument.

Key ideas

  • The indicator creates monthly tables marking trading days, weekends, holidays, and a configurable weekly expiry day.
  • Users can choose the expiry weekday and customize expiry markers and calendar colors.
  • When the selected weekday is not a trading day, the script assigns expiry to an earlier available trading day.
  • Calendar classifications depend on the daily data available for the chart instrument.
  • The displayed dates should be checked against the relevant exchange and contract rules.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.