addMarketHoliday

Syntax

addMarketHoliday(marketName, holiday)

Arguments

marketName is a STRING scalar, indicating the identifier of the trading calendar, e.g., the Market Identifier Code of an exchange, or a user-defined calendar name.

holiday is a vector of DATE type, indicating weekday holidays.

Details

Adds a holiday calendar online to generate a trading calendar. A CSV file named marketName will be generated in the directory specified by marketHolidayDir.

Note:

  • It can only be executed by an administrator.

  • It only takes effect on the current node. In a cluster, pnodeRun can be used to call this function on all data/compute nodes.

  • marketNamemust consist of four uppercase letters and cannot be the same as the file name in marketHolidayDir.

Examples

addMarketHoliday("DCBA",2022.01.03 2022.01.05)
temporalAdd(2022.01.01,1,"DCBA")

//Output: 2022.01.04
index = [2022.01.01, 2022.01.02, 2022.01.03, 2022.01.04]
s = indexedSeries(index, 1..4)
s.resample("DCBA", sum);
label col1
2021.12.31 6
2022.01.04 4

Related functions: updateMarketHoliday, getMarketCalendar.