Skip to content
All library documents

Using Historical Market Holidays in Trading Indicators

Article TradingView scripts

Summary

This Pine Script library provides country-specific market holiday timestamps, including special historical closures, as arrays that other indicators and strategies can use. Its exported function accepts a country code and combines data held in separate libraries covering successive historical periods. The author says the data was generated with a Python script using a market-calendar package.

The library is intended to help scripts account for non-trading days, including when estimating future bar positions from calendar dates. The source advises subtracting weekends and listed closures from such calculations. It is a data utility rather than a trading signal or strategy, and the document gives no assessment of calendar coverage, exchange-specific exceptions, or timestamp accuracy. Users should account for the relevant market’s calendar and verify that the country-level dates match their instrument and session conventions.

Key ideas

  • The exported function aggregates holiday timestamps for a specified country code.
  • The holiday data is split across historical periods and combined into one array.
  • The library can help scripts account for closures when calculating bar positions from dates.
  • The timestamps are described as generated with a Python market-calendar package.
  • Country-level holiday data may require verification against an instrument’s exchange and session conventions.

Tags

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