Lean  $LEAN_TAG$
SecurityReference.cs
1 /*
2  * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
3  * Lean Algorithmic Trading Engine v2.0. Copyright 2023 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 
17 using System;
18 using System.Linq;
19 using Python.Runtime;
20 using Newtonsoft.Json;
21 using System.Collections.Generic;
23 
25 {
26  /// <summary>
27  /// Definition of the SecurityReference class
28  /// </summary>
30  {
31  /// <summary>
32  /// An arrangement of characters (often letters) representing a particular security listed on an exchange or otherwise traded publicly. Note: Morningstar's multi-share class symbols will often contain a "period" within the symbol; e.g. BRK.B for Berkshire Hathaway Class B.
33  /// </summary>
34  /// <remarks>
35  /// Morningstar DataId: 1001
36  /// </remarks>
37  [JsonProperty("1001")]
38  public string SecuritySymbol => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_SecuritySymbol);
39 
40  /// <summary>
41  /// The Id representing the stock exchange that the particular share class is trading. See separate reference document for Exchange Mappings.
42  /// </summary>
43  /// <remarks>
44  /// Morningstar DataId: 1002
45  /// </remarks>
46  [JsonProperty("1002")]
47  public string ExchangeId => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_ExchangeId);
48 
49  /// <summary>
50  /// 3 Character ISO code of the currency that the exchange price is denominated in; i.e. the trading currency of the security. See separate reference document for Currency Mappings.
51  /// </summary>
52  /// <remarks>
53  /// Morningstar DataId: 1004
54  /// </remarks>
55  [JsonProperty("1004")]
56  public string CurrencyId => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_CurrencyId);
57 
58  /// <summary>
59  /// The initial day that the share begins trading on a public exchange.
60  /// </summary>
61  /// <remarks>
62  /// Morningstar DataId: 1009
63  /// </remarks>
64  [JsonProperty("1009")]
65  public DateTime IPODate => FundamentalService.Get<DateTime>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_IPODate);
66 
67  /// <summary>
68  /// Indicator to denote if the share class is a depository receipt. 1 denotes it is an ADR or GDR; otherwise 0.
69  /// </summary>
70  /// <remarks>
71  /// Morningstar DataId: 1010
72  /// </remarks>
73  [JsonProperty("1010")]
74  public bool IsDepositaryReceipt => FundamentalService.Get<bool>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_IsDepositaryReceipt);
75 
76  /// <summary>
77  /// The number of underlying common shares backing each American Depository Receipt traded.
78  /// </summary>
79  /// <remarks>
80  /// Morningstar DataId: 1011
81  /// </remarks>
82  [JsonProperty("1011")]
83  public double DepositaryReceiptRatio => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_DepositaryReceiptRatio);
84 
85  /// <summary>
86  /// Each security will be assigned to one of the below security type classifications; - Common Stock (ST00000001) - Preferred Stock (ST00000002) - Units (ST000000A1)
87  /// </summary>
88  /// <remarks>
89  /// Morningstar DataId: 1012
90  /// </remarks>
91  [JsonProperty("1012")]
92  public string SecurityType => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_SecurityType);
93 
94  /// <summary>
95  /// Provides information when applicable such as whether the share class is Class A or Class B, an ADR, GDR, or a business development company (BDC). For preferred stocks, this field provides more detail about the preferred share class.
96  /// </summary>
97  /// <remarks>
98  /// Morningstar DataId: 1013
99  /// </remarks>
100  [JsonProperty("1013")]
101  public string ShareClassDescription => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_ShareClassDescription);
102 
103  /// <summary>
104  /// At the ShareClass level; each share is assigned to 1 of 4 possible status classifications; (A) Active, (D) Deactive, (I) Inactive, or (O) Obsolete: - Active-Share class is currently trading in a public market, and we have fundamental data available. - Deactive-Share class was once Active, but is no longer trading due to share being delisted from the exchange. - Inactive-Share class is currently trading in a public market, but no fundamental data is available. - Obsolete-Share class was once Inactive, but is no longer trading due to share being delisted from the exchange.
105  /// </summary>
106  /// <remarks>
107  /// Morningstar DataId: 1014
108  /// </remarks>
109  [JsonProperty("1014")]
110  public string ShareClassStatus => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_ShareClassStatus);
111 
112  /// <summary>
113  /// This indicator will denote if the indicated share is the primary share for the company. A "1" denotes the primary share, a "0" denotes a share that is not the primary share. The primary share is defined as the first share that a company IPO'd with and is still actively trading. If this share is no longer trading, we will denote the primary share as the share with the highest volume.
114  /// </summary>
115  /// <remarks>
116  /// Morningstar DataId: 1015
117  /// </remarks>
118  [JsonProperty("1015")]
119  public bool IsPrimaryShare => FundamentalService.Get<bool>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_IsPrimaryShare);
120 
121  /// <summary>
122  /// Shareholder election plan to re-invest cash dividend into additional shares.
123  /// </summary>
124  /// <remarks>
125  /// Morningstar DataId: 1016
126  /// </remarks>
127  [JsonProperty("1016")]
128  public bool IsDividendReinvest => FundamentalService.Get<bool>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_IsDividendReinvest);
129 
130  /// <summary>
131  /// A plan to make it possible for individual investors to invest in public companies without going through a stock broker.
132  /// </summary>
133  /// <remarks>
134  /// Morningstar DataId: 1017
135  /// </remarks>
136  [JsonProperty("1017")]
137  public bool IsDirectInvest => FundamentalService.Get<bool>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_IsDirectInvest);
138 
139  /// <summary>
140  /// Identifier assigned to each security Morningstar covers.
141  /// </summary>
142  /// <remarks>
143  /// Morningstar DataId: 1018
144  /// </remarks>
145  [JsonProperty("1018")]
146  public string InvestmentId => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_InvestmentId);
147 
148  /// <summary>
149  /// IPO offer price indicates the price at which an issuer sells its shares under an initial public offering (IPO). The offer price is set by issuer and its underwriters.
150  /// </summary>
151  /// <remarks>
152  /// Morningstar DataId: 1019
153  /// </remarks>
154  [JsonProperty("1019")]
155  public double IPOOfferPrice => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_IPOOfferPrice);
156 
157  /// <summary>
158  /// The date on which an inactive security was delisted from an exchange.
159  /// </summary>
160  /// <remarks>
161  /// Morningstar DataId: 1020
162  /// </remarks>
163  [JsonProperty("1020")]
164  public DateTime DelistingDate => FundamentalService.Get<DateTime>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_DelistingDate);
165 
166  /// <summary>
167  /// The reason for an inactive security's delisting from an exchange. The full list of Delisting Reason codes can be found within the Data Definitions- Appendix A DelistingReason Codes tab.
168  /// </summary>
169  /// <remarks>
170  /// Morningstar DataId: 1021
171  /// </remarks>
172  [JsonProperty("1021")]
173  public string DelistingReason => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_DelistingReason);
174 
175  /// <summary>
176  /// The MIC (market identifier code) of the related shareclass of the company. See Data Appendix A for the relevant MIC to exchange name mapping.
177  /// </summary>
178  /// <remarks>
179  /// Morningstar DataId: 1022
180  /// </remarks>
181  [JsonProperty("1022")]
182  public string MIC => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_MIC);
183 
184  /// <summary>
185  /// Refers to the type of securities that can be found within the equity database. For the vast majority, this value will populate as null for regular common shares. For a minority of shareclasses, this will populate as either "Participating Preferred", "Closed-End Fund", "Foreign Share", or "Foreign Participated Preferred" which reflects our limited coverage of these types of securities within our equity database.
186  /// </summary>
187  /// <remarks>
188  /// Morningstar DataId: 1023
189  /// </remarks>
190  [JsonProperty("1023")]
191  public string CommonShareSubType => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_CommonShareSubType);
192 
193  /// <summary>
194  /// The estimated offer price range (low-high) for a new IPO. The field should be used until the final IPO price becomes available, as populated in the data field "IPOPrice".
195  /// </summary>
196  /// <remarks>
197  /// Morningstar DataId: 1024
198  /// </remarks>
199  [JsonProperty("1024")]
200  public string IPOOfferPriceRange => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_IPOOfferPriceRange);
201 
202  /// <summary>
203  /// Classification to denote different Marketplace or Market tiers within a stock exchange.
204  /// </summary>
205  /// <remarks>
206  /// Morningstar DataId: 1025
207  /// </remarks>
208  [JsonProperty("1025")]
209  public string ExchangeSubMarketGlobalId => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_ExchangeSubMarketGlobalId);
210 
211  /// <summary>
212  /// The relationship between the chosen share class and the primary share class.
213  /// </summary>
214  /// <remarks>
215  /// Morningstar DataId: 1026
216  /// </remarks>
217  [JsonProperty("1026")]
218  public double ConversionRatio => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_ConversionRatio);
219 
220  /// <summary>
221  /// Nominal value of a security determined by the issuing company.
222  /// </summary>
223  /// <remarks>
224  /// Morningstar DataId: 1027
225  /// </remarks>
226  [JsonProperty("1027")]
227  public double ParValue => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_ParValue);
228 
229  /// <summary>
230  /// <remarks> Morningstar DataId: 1028 </remarks>
231  /// </summary>
232  /// <remarks>
233  /// Morningstar DataId: 1028
234  /// </remarks>
235  [JsonProperty("1028")]
236  public bool TradingStatus => FundamentalService.Get<bool>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_TradingStatus);
237 
238  /// <summary>
239  /// <remarks> Morningstar DataId: 1029 </remarks>
240  /// </summary>
241  /// <remarks>
242  /// Morningstar DataId: 1029
243  /// </remarks>
244  [JsonProperty("1029")]
245  public string MarketDataID => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_MarketDataID);
246 
247  /// <summary>
248  /// Creates a new instance for the given time and security
249  /// </summary>
250  public SecurityReference(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier)
251  : base(timeProvider, securityIdentifier)
252  {
253  }
254 
255  /// <summary>
256  /// Clones this instance
257  /// </summary>
259  {
260  return new SecurityReference(timeProvider, _securityIdentifier);
261  }
262  }
263 }