How to generate a list of the NYSE trading days in a date range in DolphinDB?
Is there a function for that?
How can I get a trading day list? Thanks in advance!
You can specify NYSE holidays and then define a function to get the NYSE trading days.
Here is an example:
The month of January 2020 has two holidays (Jan 01 and Jan 20).
days=2020.01.01..2020.01.31
holiday=[2020.01.01,2020.01.20]
def getTradingDays(days,holiday){
return days[weekday(days) between 1:5 and not days in holiday]
}
getTradingDays(days,holiday)