annualTradingDays#
Purpose#
Computes number of trading days in a given year.
Format#
- n = annualTradingDays(a)#
- Parameters:
a (scalar) – year.
- Returns:
n (scalar) – number of trading days in year.
Remarks#
A trading day is a weekday that is not a holiday as defined by the New
York Stock Exchange from 1888 through 2020. Holidays are defined in
holidays.asc. You may edit that file to modify or add holidays.
Globals#
- _fin_annualTradingDays#
- _fin_holidays#
Examples#
// Get the number of NYSE trading days in 2023
n = annualTradingDays(2023);
print (n);
The above code sets n to 250.
// Compare trading days across years
for i (2020, 2024, 1);
n = annualTradingDays(i);
print i;; print " trading days: ";; print n;
endfor;
Source#
finutils.src
See also
Functions elapsedTradingDays(), getNextTradingDay(), getPreviousTradingDay(), getNextWeekDay(), getPreviousWeekday()