Lean  $LEAN_TAG$
TradingDay.cs
1 /*
2  * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
3  * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14 */
15 
16 using System;
17 using System.Collections.Generic;
18 
19 namespace QuantConnect
20 {
21  /// <summary>
22  /// Enum lists available trading events
23  /// </summary>
24  public enum TradingDayType
25  {
26  /// <summary>
27  /// Business day (0)
28  /// </summary>
30 
31  /// <summary>
32  /// Public Holiday (1)
33  /// </summary>
35 
36  /// <summary>
37  /// Weekend (2)
38  /// </summary>
39  Weekend,
40 
41  /// <summary>
42  /// Option Expiration Date (3)
43  /// </summary>
45 
46  /// <summary>
47  /// Futures Expiration Date (4)
48  /// </summary>
50 
51  /// <summary>
52  /// Futures Roll Date (5)
53  /// </summary>
54  /// <remarks>Not used yet. For future use.</remarks>
55  FutureRoll,
56 
57  /// <summary>
58  /// Symbol Delisting Date (6)
59  /// </summary>
60  /// <remarks>Not used yet. For future use.</remarks>
62 
63  /// <summary>
64  /// Equity Ex-dividend Date (7)
65  /// </summary>
66  /// <remarks>Not used yet. For future use.</remarks>
68 
69  /// <summary>
70  /// FX Economic Event (8)
71  /// </summary>
72  /// <remarks>FX Economic Event e.g. from DailyFx (DailyFx.cs). Not used yet. For future use.</remarks>
74  }
75 
76  /// <summary>
77  /// Class contains trading events associated with particular day in <see cref="TradingCalendar"/>
78  /// </summary>
79  public class TradingDay
80  {
81  /// <summary>
82  /// The date that this instance is associated with
83  /// </summary>
84  public DateTime Date { get; internal set; }
85 
86  /// <summary>
87  /// Property returns true, if the day is a business day
88  /// </summary>
89  public bool BusinessDay { get; internal set; }
90 
91  /// <summary>
92  /// Property returns true, if the day is a public holiday
93  /// </summary>
94  public bool PublicHoliday { get; internal set; }
95 
96  /// <summary>
97  /// Property returns true, if the day is a weekend
98  /// </summary>
99  public bool Weekend { get; internal set; }
100 
101  /// <summary>
102  /// Property returns the list of options (among currently traded) that expire on this day
103  /// </summary>
104  public IEnumerable<Symbol> OptionExpirations { get; internal set; }
105 
106  /// <summary>
107  /// Property returns the list of futures (among currently traded) that expire on this day
108  /// </summary>
109  public IEnumerable<Symbol> FutureExpirations { get; internal set; }
110 
111  /// <summary>
112  /// Property returns the list of futures (among currently traded) that roll forward on this day
113  /// </summary>
114  /// <remarks>Not used yet. For future use.</remarks>
115  public IEnumerable<Symbol> FutureRolls { get; internal set; }
116 
117  /// <summary>
118  /// Property returns the list of symbols (among currently traded) that are delisted on this day
119  /// </summary>
120  /// <remarks>Not used yet. For future use.</remarks>
121  public IEnumerable<Symbol> SymbolDelistings { get; internal set; }
122 
123  /// <summary>
124  /// Property returns the list of symbols (among currently traded) that have ex-dividend date on this day
125  /// </summary>
126  /// <remarks>Not used yet. For future use.</remarks>
127  public IEnumerable<Symbol> EquityDividends { get; internal set; }
128  }
129 }