Events
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © sherwoodherben2

//@version=5

// original credit to:
// © jdehorty


// @description This library is a data provider for important Dates and Times from the Economic Calendar.
// Updates and additions by Sherwood
// [1/11/23] (published as revision 2.0)]
	// added CPI calendar for 2023
// [1/11/23] (published as revision 5.0)]
	// added PPI calendar for 2023
// [1/15/23] (published as revision 11.0)
     // added ECI for 2022/23


library(title='Events')

// @function Returns the list of dates supported by this library as a string array.
// @returns
//		array<string> : Names of events supported by this library
export events () =>
	var array<string> events = array.from(
     "FOMC Meetings", // Federal Open Market Committee
     "FOMC Minutes", // FOMC Meeting Minutes
     "PPI", // Producer Price Index
     "CPI", // Consumer Price Index
     "CSI", // Consumer Sentiment Index
     "CCI", // Consumer Confidence Index
     "NFP", // Non-Farm Payrolls
     "ECI" // Employment Cost Index
     )

// @function Gets the FOMC Meeting Dates. The FOMC meets eight times a year to determine the course of monetary policy. The FOMC announces its decision on the federal funds rate at the conclusion of each meeting and also issues a statement that provides information on the economic outlook and the Committee's assessment of the risks to the outlook. 
// @returns
//		array<int> : FOMC Meeting Dates as timestamps
export fomcMeetings() =>
	array.from(
         timestamp("26 Jan 2022 14:00:00 EST"), // 2022
         timestamp("16 March 2022 14:00:00 EDT"),
         timestamp("4 May 2022 14:00:00 EDT"),
         timestamp("15 June 2022 14:00:00 EDT"),
         timestamp("27 July 2022 14:00:00 EDT"),
         timestamp("21 Sept 2022 14:00:00 EDT"),
         timestamp("2 Nov 2022 14:00:00 EDT"),
         timestamp("14 Dec 2022 14:00:00 EST"),
         timestamp("1 Feb 2023 14:00:00 EST"), // 2023
         timestamp("22 March 2023 14:00:00 EDT"),
         timestamp("3 May 2023 14:00:00 EDT"),
         timestamp("14 June 2023 14:00:00 EDT"),
         timestamp("26 July 2023 14:00:00 EDT"),
         timestamp("20 Sept 2023 14:00:00 EDT"),
         timestamp("1 Nov 2023 14:00:00 EDT"),
         timestamp("13 Dec 2023 14:00:00 EST")
	     )

// @function Gets the FOMC Meeting Minutes Dates. The FOMC Minutes are released three weeks after each FOMC meeting. The Minutes provide information on the Committee's deliberations and decisions at the meeting.
// @returns 
//		array<int> : FOMC Meeting Minutes Dates as timestamps
export fomcMinutes() =>
    array.from(
         timestamp("16 Feb 2022 14:00:00 EST"), // 2022
         timestamp("6 April 2022 14:00:00 EDT"), 
         timestamp("25 May 2022 14:00:00 EDT"), 
         timestamp("6 July 2022 14:00:00 EDT"),
         timestamp("17 Aug 2022 14:00:00 EDT"),
         timestamp("12 Oct 2022 14:00:00 EDT"),
         timestamp("23 Nov 2022 14:00:00 EST"),
         timestamp("4 Jan 2023 14:00:00 EST"), // 2023
         timestamp("22 Feb 2023 14:00:00 EST"),
         timestamp("12 April 2023 14:00:00 EDT"),
         timestamp("24 May 2023 14:00:00 EDT"),
         timestamp("5 July 2023 14:00:00 EDT"),
         timestamp("16 Aug 2023 14:00:00 EDT"),
         timestamp("11 Oct 2023 14:00:00 EDT"),
         timestamp("22 Nov 2023 14:00:00 EST"),
         timestamp("3 Jan 2024 14:00:00 EST")
         )

// @function Gets the Producer Price Index (PPI) Dates. The Producer Price Index (PPI) measures the average change over time in the selling prices received by domestic producers for their output. The PPI is a leading indicator of CPI, and CPI is a leading indicator of inflation.
// @returns
//		array<int> : PPI Dates as timestamps
export ppiReleases() =>
    array.from(
         timestamp("9 Nov 2021 8:30:00 EST"), // 2021
         timestamp("14 Dec 2021 8:30:00 EST"),
         timestamp("13 Jan 2022 8:30:00 EST"), // 2022
         timestamp("15 Feb 2022 8:30:00 EST"),
         timestamp("15 Mar 2022 8:30:00 EST"),
         timestamp("13 Apr 2022 8:30:00 EDT"),
         timestamp("12 May 2022 8:30:00 EDT"),
         timestamp("14 Jun 2022 8:30:00 EDT"),
         timestamp("14 Jul 2022 8:30:00 EDT"),
         timestamp("11 Aug 2022 8:30:00 EDT"),
         timestamp("14 Sep 2022 8:30:00 EDT"),
         timestamp("12 Oct 2022 8:30:00 EDT"),
         timestamp("15 Nov 2022 8:30:00 EST"),
         timestamp("9 Dec 2022 8:30:00 EST"),
         timestamp("18 Jan 2023 8:30:00 EST"), // 2023
         timestamp("16 Feb 2023 8:30:00 EST"),
         timestamp("15 Mar 2023 8:30:00 EST"),
         timestamp("13 Apr 2023 8:30:00 EDT"),
         timestamp("11 May 2023 8:30:00 EDT"),
         timestamp("14 Jun 2023 8:30:00 EDT"),
         timestamp("13 Jul 2023 8:30:00 EDT"),
         timestamp("11 Aug 2023 8:30:00 EDT"),
         timestamp("14 Sep 2023 8:30:00 EDT"),
         timestamp("11 Oct 2023 8:30:00 EDT"),
         timestamp("15 Nov 2023 8:30:00 EST"),
         timestamp("9 Dec 2023 8:30:00 EST")
         )

// @function Gets the Consumer Price Index (CPI) Rekease Dates. The Consumer Price Index (CPI) measures changes in the price level of a market basket of consumer goods and services purchased by households. The CPI is a leading indicator of inflation.
// @returns
//		array<int> : CPI Dates as timestamps
export cpiReleases() =>
    array.from(
         timestamp("12 Jan 2022 08:30:00 EST"), // 2022
         timestamp("10 Feb 2022 08:30:00 EST"),
         timestamp("10 March 2022 08:30:00 EST"),
         timestamp("12 April 2022 08:30:00 EDT"),
         timestamp("11 May 2022 08:30:00 EDT"),
         timestamp("10 June 2022 08:30:00 EDT"),
         timestamp("13 July 2022 08:30:00 EDT"),
         timestamp("10 Aug 2022 08:30:00 EDT"),
         timestamp("13 Sept 2022 08:30:00 EDT"),
         timestamp("13 Oct 2022 08:30:00 EDT"),
         timestamp("10 Nov 2022 08:30:00 EST"),
         timestamp("13 Dec 2022 08:30:00 EST"),
         timestamp("12 Jan 2023 08:30:00 EST"), // 2022
         timestamp("14 Feb 2023 08:30:00 EST"),
         timestamp("14 March 2023 08:30:00 EST"),
         timestamp("12 April 2023 08:30:00 EDT"),
         timestamp("10 May 2023 08:30:00 EDT"),
         timestamp("12 June 2023 08:30:00 EDT"),
         timestamp("12 July 2023 08:30:00 EDT"),
         timestamp("10 Aug 2023 08:30:00 EDT"),
         timestamp("13 Sept 2023 08:30:00 EDT"),
         timestamp("12 Oct 2023 08:30:00 EDT"),
         timestamp("14 Nov 2023 08:30:00 EST"),
         timestamp("11 Dec 2023 08:30:00 EST")
         )

// @function Gets the CSI release dates. The Consumer Sentiment Index (CSI) is a survey of consumer attitudes about the economy and their personal finances. The CSI is a leading indicator of consumer spending.
// @returns
//		array<int> : CSI Dates as timestamps  
export csiReleases() =>
    array.from(
         timestamp("14 Jan 2022 10:00:00 EST"), // 2022
         timestamp("28 Jan 2022 10:00:00 EST"),
         timestamp("11 Feb 2022 10:00:00 EST"),
         timestamp("25 Feb 2022 10:00:00 EST"),
         timestamp("18 March 2022 10:00:00 EDT"),
         timestamp("1 April 2022 10:00:00 EDT"),
         timestamp("15 April 2022 10:00:00 EDT"),
         timestamp("29 April 2022 10:00:00 EDT"),
         timestamp("13 May 2022 10:00:00 EDT"),
         timestamp("27 May 2022 10:00:00 EDT"),
         timestamp("17 June 2022 10:00:00 EDT"),
         timestamp("1 July 2022 10:00:00 EDT"),
         timestamp("15 July 2022 10:00:00 EDT"),
         timestamp("29 July 2022 10:00:00 EDT"),
         timestamp("12 Aug 2022 10:00:00 EDT"),
         timestamp("26 Aug 2022 10:00:00 EDT"),
         timestamp("16 Sept 2022 10:00:00 EDT"),
         timestamp("30 Sept 2022 10:00:00 EDT"),
         timestamp("14 Oct 2022 10:00:00 EDT"),
         timestamp("28 Oct 2022 10:00:00 EDT"),
         timestamp("11 Nov 2022 10:00:00 EST"),
         timestamp("23 Nov 2022 10:00:00 EST"),
         timestamp("9 Dec 2022 10:00:00 EST"),
         timestamp("23 Dec 2022 10:00:00 EST"),
         timestamp("13 Jan 2023 10:00:00 EST"), // 2023
         timestamp("27 Jan 2023 10:00:00 EST"),
         timestamp("10 Feb 2023 10:00:00 EST"),
         timestamp("24 Feb 2023 10:00:00 EST"),
         timestamp("17 March 2023 10:00:00 EDT"),
         timestamp("31 March 2023 10:00:00 EDT"),
         timestamp("14 April 2023 10:00:00 EDT"),
         timestamp("28 April 2023 10:00:00 EDT"),
         timestamp("12 May 2023 10:00:00 EDT"),
         timestamp("26 May 2023 10:00:00 EDT"),
         timestamp("16 June 2023 10:00:00 EDT"),
         timestamp("30 June 2023 10:00:00 EDT"),
         timestamp("14 July 2023 10:00:00 EDT"),
         timestamp("28 July 2023 10:00:00 EDT"),
         timestamp("11 Aug 2023 10:00:00 EDT"),
         timestamp("25 Aug 2023 10:00:00 EDT"),
         timestamp("15 Sept 2023 10:00:00 EDT"),
         timestamp("29 Sept 2023 10:00:00 EDT"),
         timestamp("13 Oct 2023 10:00:00 EDT"),
         timestamp("27 Oct 2023 10:00:00 EDT"),
         timestamp("10 Nov 2023 10:00:00 EST"),
         timestamp("22 Nov 2023 10:00:00 EST"),
         timestamp("8 Dec 2023 10:00:00 EST"),
         timestamp("22 Dec 2023 10:00:00 EST")
         )

// @function Gets the CCI release dates. The Conference Board's Consumer Confidence Index (CCI) is a survey of consumer attitudes about the economy and their personal finances. The CCI is a leading indicator of consumer spending.
// @returns
//		array<int> : CCI Dates as timestamps  
export cciReleases() =>
    array.from(
         timestamp("25 Jan 2022 10:00:00 EST"), // 2022
         timestamp("22 Feb 2022 10:00:00 EST"),
         timestamp("29 March 2022 10:00:00 EDT"),
         timestamp("26 April 2022 10:00:00 EDT"),
         timestamp("31 May 2022 10:00:00 EDT"),
         timestamp("28 June 2022 10:00:00 EDT"),
         timestamp("26 July 2022 10:00:00 EDT"),
         timestamp("30 Aug 2022 10:00:00 EDT"),
         timestamp("27 Sept 2022 10:00:00 EDT"),
         timestamp("25 Oct 2022 10:00:00 EDT"),
         timestamp("29 Nov 2022 10:00:00 EST"),
         timestamp("27 Dec 2022 10:00:00 EST"),
         timestamp("31 Jan 2023 10:00:00 EST"), // 2023
         timestamp("28 Feb 2023 10:00:00 EST"),
         timestamp("28 March 2023 10:00:00 EDT"),
         timestamp("25 April 2023 10:00:00 EDT"),
         timestamp("30 May 2023 10:00:00 EDT"),
         timestamp("27 June 2023 10:00:00 EDT"),
         timestamp("25 July 2023 10:00:00 EDT"),
         timestamp("29 Aug 2023 10:00:00 EDT"),
         timestamp("26 Sept 2023 10:00:00 EDT"),
         timestamp("31 Oct 2023 10:00:00 EDT"),
         timestamp("28 Nov 2023 10:00:00 EST"),
         timestamp("26 Dec 2023 10:00:00 EST")
         )

// @function Gets the NFP release dates. Nonfarm payrolls is an employment report released monthly by the Bureau of Labor Statistics (BLS) that measures the change in the number of employed people in the United States.
// @returns
//		array<int> : NFP Dates as timestamps  
export nfpReleases() => 
    array.from(
          timestamp("7 Jan 2022 8:30:00 EST"), // 2022
         timestamp("4 Feb 2022 8:30:00 EST"),
         timestamp("4 March 2022 8:30:00 EST"),
         timestamp("1 April 2022 8:30:00 EDT"),
         timestamp("6 May 2022 8:30:00 EDT"),
         timestamp("3 June 2022 8:30:00 EDT"),
         timestamp("8 July 2022 8:30:00 EDT"),
         timestamp("5 Aug 2022 8:30:00 EDT"),
         timestamp("2 Sept 2022 8:30:00 EDT"),
         timestamp("7 Oct 2022 8:30:00 EDT"),
         timestamp("4 Nov 2022 8:30:00 EDT"),
         timestamp("2 Dec 2022 8:30:00 EST"),
         timestamp("6 Jan 2023 8:30:00 EST"), // 2023
         timestamp("3 Feb 2023 8:30:00 EST"),
         timestamp("3 March 2023 8:30:00 EST"),
         timestamp("7 April 2023 8:30:00 EDT"),
         timestamp("5 May 2023 8:30:00 EDT"),
         timestamp("2 June 2023 8:30:00 EDT"),
         timestamp("7 July 2023 8:30:00 EDT"),
         timestamp("4 Aug 2023 8:30:00 EDT"),
         timestamp("1 Sept 2023 8:30:00 EDT"),
         timestamp("6 Oct 2023 8:30:00 EDT"),
         timestamp("3 Nov 2023 8:30:00 EDT"),
         timestamp("1 Dec 2023 8:30:00 EST")
         )

// @function Gets the ECI The Employment Cost Index (ECI) is a measure of the change in the cost of labor,
export eciReleases() => 
    array.from(
         timestamp("31 Jan 2022 8:30:00 EST"), // 2022
         timestamp("29 Apr 2022 8:30:00 EST"), 
         timestamp("29 Jul 2022 8:30:00 EST"), 
         timestamp("31 oct 2022 8:30:00 EST"), 
         timestamp("31 Jan 2023 8:30:00 EST"), // 2023
         timestamp("28 Apr 2023 8:30:00 EST"), 
         timestamp("28 Jul 2023 8:30:00 EST"), 
         timestamp("31 oct 2023 8:30:00 EST")
         )

