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. Note that marketName cannot be the same as the file name in marketHolidayDir.

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.

Examples

$ addMarketHoliday("CFFEX",2022.01.03 2022.01.05)
$ temporalAdd(2022.01.01,1,"CFFEX")
2022.01.04
$ index = [2022.01.01, 2022.01.02, 2022.01.03, 2022.01.04]
$ s = indexedSeries(index, 1..4)
$ s.resample("CFFEX", sum);
label col1
2021.12.31 6
2022.01.04 4

Related functions: updateMarketHoliday, getMarketCalendar