Functions Data

DateSeries

The DateSeries() function returns a sequence of dates within a specified range.

  • The Frequency parameter determines the spacing between dates (e.g., daily, month-end, trading days only, week start, etc.)

If trading days are specified, weekends and public holidays (according to the relevant securities exchange or country) are excluded.


Syntax:

Qx.DateSeries(Start Date, End Date, Evaluation Date, Frequency, ShowError)
  • In Excel with Quintessence addin versions prior to 25.1, use: DateSeries()
  • In the Quintessence Editor (Studio) using Quintessence language, use: DateSeries()
  • In the Quintessence Editor (Studio) using Python language, use: Qx.DateSeries()
See parameter descriptions

Start Date
(optional)
The start date for the range.
End Date
(optional)
The end date for the range.
Frequency
(optional)
Depending on the frequency selected, a date in the range may or may not be
included in the result. Possible values:
D – Days
WS – Week starts
WE – Week ends
MS – Month starts
ME – Month ends
QS – Quarter starts
QE – Quarter ends
YS – Year starts
YE – Year ends
Any value prefixed with T means trading days only.
For example, TWE means week ends that are also trading days.
ShowError
(optional)
If TRUE, an error message is displayed when the function fails.

Remarks:

  • Unless changed by an administrator, the default parameters are:
    • Start Date: today
    • End Date: today
    • Frequency: TD
  • The default exchange code used for determining trading days is set by the administrator.

Examples:

> Example 1: Trading week starts in April 2015


Return all trading week starts in April 2015. April 7 is included because April 6 was a public holiday for the default exchange and not a trading day.

=Qx.DateSeries("1 April 2015","30 April 2015","tws")
2015/04/07
2015/04/13
2015/04/20
2015/04/28
> Example 2: Trading month ends in 2015
=Qx.DateSeries("1 Jan 2015","31 Dec 2015","tme")
2015/01/30
2015/02/27
2015/03/31
2015/04/30
2015/05/29
2015/06/30
2015/07/31
2015/08/31
2015/09/30
2015/10/30
2015/11/30
2015/12/31
> Example 3: Week starts for the next 60 days


Using DateOffset() as 2 June 2015:

=Qx.DateSeries(Qx.DateOffset(),Qx.DateOffset()+60,"ws")
2015/06/08
2015/06/15
2015/06/22
2015/06/29
2015/07/06
2015/07/13
2015/07/20
2015/07/27