elapsedTradingDays

Purpose

Computes number of trading days between two dates inclusively.

Format

n_days = elapsedTradingDays(t_start, t_end)
Parameters
  • t_start (scalar) – date in DT scalar format.

  • t_end (scalar) – date in DT scalar format.

Returns

n_days (Scalar) – number of trading days between dates inclusively, that is, elapsed time includes the dates t_start and t_end.

Examples

// September 10, 2015
t_start = 20150910110231;

// September 28, 2015
t_end = 20150928080722;

n_days = elapsedTradingDays(t_start, t_end);
n_days = 12

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.

Source

finutils.src