updateMarketHoliday
Syntax
updateMarketHoliday(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 holiday dates or trading dates.
-
When dateType='holidayDate', holiday should be specified as the dates of weekday holidays.
-
When dateType='tradingDate', holiday should be specified as trading dates.
Details
Updates file of holiday dates or trading dates named marketName in memory online and synchronizes updates to the file in marketHolidayDir. If the file does not exist in memory, an error will be reported.
-
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. -
If you have manually modified the trading calendar under marketHolidayDir and want to synchronize updates to memory without restarting the server, you can use function
loadText
to load the updated CSV file to an in-memory table and convert it to a vector (holiday), then update the holiday to memory byupdateMarketHoliday
.
Examples
addMarketHoliday("CFFEX",2022.01.03 2022.01.05)
temporalAdd(2022.01.01,1,"CFFEX")
// output
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 |
updateMarketHoliday("CFFEX",2022.01.03 2022.01.04)
temporalAdd(2022.01.01,1,"CFFEX")
// output
2022.01.05
Related functions: addMarketHoliday, getMarketCalendar