Lean
$LEAN_TAG$
|
Represents a unique security identifier. This is made of two components, the unique SID and the Value. The value is the current ticker symbol while the SID is constant over the life of a security More...
Public Member Functions | |
bool | IsCanonical () |
Method returns true, if symbol is a derivative canonical symbol More... | |
bool | HasCanonical () |
Determines whether the symbol has a canonical representation More... | |
bool | HasUnderlyingSymbol (Symbol symbol) |
Determines if the specified symbol is an underlying of this symbol instance More... | |
Symbol (SecurityIdentifier sid, string value) | |
Initializes a new instance of the Symbol class More... | |
Symbol | UpdateMappedSymbol (string mappedSymbol, uint contractDepthOffset=0) |
Creates new symbol with updated mapped symbol. Symbol Mapping: When symbols change over time (e.g. CHASE-> JPM) need to update the symbol requested. Method returns newly created symbol More... | |
override bool | Equals (object obj) |
Determines whether the specified T:System.Object is equal to the current T:System.Object. More... | |
override int | GetHashCode () |
Serves as a hash function for a particular type. More... | |
int | CompareTo (object obj) |
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. More... | |
override string | ToString () |
Returns a string that represents the current object. More... | |
bool | Equals (Symbol other) |
Indicates whether the current object is equal to another object of the same type. More... | |
bool | Contains (string value) |
bool | EndsWith (string value) |
bool | StartsWith (string value) |
string | ToLower () |
string | ToUpper () |
Static Public Member Functions | |
static Symbol | Create (string ticker, SecurityType securityType, string market, string alias=null, Type baseDataType=null) |
Provides a convenience method for creating a Symbol for most security types. This method currently does not support Commodities More... | |
static Symbol | CreateBase (PyObject baseType, Symbol underlying, string market=null) |
Creates a new Symbol for custom data. This method allows for the creation of a new Base Symbol using the first ticker and the first traded date from the provided underlying Symbol. This avoids the issue for mappable types, where the ticker is remapped supposing the provided ticker value is from today. See SecurityIdentifier's private method GetFirstTickerAndDate. The provided symbol is also set to Symbol.Underlying so that it can be accessed using the custom data Symbol. This is useful for associating custom data Symbols to other asset classes so that it is possible to filter using custom data and place trades on the underlying asset based on the filtered custom data. More... | |
static Symbol | CreateBase (Type baseType, Symbol underlying, string market=null) |
Creates a new Symbol for custom data. This method allows for the creation of a new Base Symbol using the first ticker and the first traded date from the provided underlying Symbol. This avoids the issue for mappable types, where the ticker is remapped supposing the provided ticker value is from today. See SecurityIdentifier's private method GetFirstTickerAndDate. The provided symbol is also set to Symbol.Underlying so that it can be accessed using the custom data Symbol. This is useful for associating custom data Symbols to other asset classes so that it is possible to filter using custom data and place trades on the underlying asset based on the filtered custom data. More... | |
static Symbol | CreateOption (string underlying, string market, OptionStyle style, OptionRight right, decimal strike, DateTime expiry, string alias=null, bool mapSymbol=true) |
Provides a convenience method for creating an option Symbol. More... | |
static Symbol | CreateOption (Symbol underlyingSymbol, string market, OptionStyle style, OptionRight right, decimal strike, DateTime expiry, string alias=null) |
Provides a convenience method for creating an option Symbol using SecurityIdentifier. More... | |
static Symbol | CreateOption (Symbol underlyingSymbol, string targetOption, string market, OptionStyle style, OptionRight right, decimal strike, DateTime expiry, string alias=null) |
Provides a convenience method for creating an option Symbol using SecurityIdentifier. More... | |
static Symbol | CreateOption (SecurityIdentifier sid, string value, Symbol underlying=null) |
Provides a convenience method for creating an option Symbol from its SecurityIdentifier and alias. More... | |
static Symbol | CreateCanonicalOption (Symbol underlyingSymbol, string market=null, string alias=null) |
Simple method to create the canonical option symbol for any given underlying symbol More... | |
static Symbol | CreateCanonicalOption (Symbol underlyingSymbol, string targetOption, string market=null, string alias=null) |
Simple method to create the canonical option symbol for any given underlying symbol More... | |
static Symbol | CreateFuture (string ticker, string market, DateTime expiry, string alias=null) |
Provides a convenience method for creating a future Symbol. More... | |
static SecurityType | GetOptionTypeFromUnderlying (Symbol underlyingSymbol) |
Determines the SecurityType based on the underlying Symbol's SecurityType More... | |
static SecurityType | GetOptionTypeFromUnderlying (SecurityType securityType) |
Determines the SecurityType based on the underlying Symbol's SecurityType GetUnderlyingFromOptionType(SecurityType) More... | |
static SecurityType | GetUnderlyingFromOptionType (SecurityType securityType) |
Determines the underlying SecurityType based on the option Symbol's SecurityType GetOptionTypeFromUnderlying(SecurityType) More... | |
static bool | operator== (Symbol left, Symbol right) |
Equals operator More... | |
static bool | operator== (Symbol left, object right) |
Equals operator More... | |
static bool | operator== (object left, Symbol right) |
Equals operator More... | |
static bool | operator!= (Symbol left, Symbol right) |
Not equals operator More... | |
static bool | operator!= (Symbol left, object right) |
Not equals operator More... | |
static bool | operator!= (object left, Symbol right) |
Not equals operator More... | |
static implicit | operator string (Symbol symbol) |
Returns the symbol's string ticker More... | |
static implicit | operator Symbol (string ticker) |
Creates symbol using string as sid More... | |
static string | GetAlias (SecurityIdentifier securityIdentifier, Symbol underlying=null) |
Centralized helper method to resolve alias for a symbol More... | |
Static Public Attributes | |
static readonly Symbol | Empty = new Symbol(SecurityIdentifier.Empty, string.Empty) |
Represents an unassigned symbol. This is intended to be used as an uninitialized, default value More... | |
static readonly Symbol | None = new Symbol(SecurityIdentifier.None, "NONE") |
Represents no symbol. This is intended to be used when no symbol is explicitly intended More... | |
Properties | |
Symbol | Canonical [get] |
Get's the canonical representation of this symbol More... | |
string | Value [get] |
Gets the current symbol for this ticker More... | |
SecurityIdentifier | ID [get] |
Gets the security identifier for this symbol More... | |
bool | HasUnderlying [get] |
Gets whether or not this Symbol is a derivative, that is, it has a valid Underlying property More... | |
Symbol | Underlying [get] |
Gets the security underlying symbol, if any More... | |
SecurityType | SecurityType [get] |
Gets the security type of the symbol More... | |
string | CUSIP [get] |
The Committee on Uniform Securities Identification Procedures (CUSIP) number corresponding to this Symbol More... | |
string | CompositeFIGI [get] |
The composite Financial Instrument Global Identifier (FIGI) corresponding to this Symbol More... | |
string | SEDOL [get] |
The Stock Exchange Daily Official List (SEDOL) security identifier corresponding to this Symbol More... | |
string | ISIN [get] |
The International Securities Identification Number (ISIN) corresponding to this Symbol More... | |
int? | CIK [get] |
The Central Index Key number (CIK) corresponding to this Symbol More... | |
Properties inherited from QuantConnect.Securities.ISymbol | |
SecurityIdentifier | ID [get] |
Gets the security identifier. More... | |
Represents a unique security identifier. This is made of two components, the unique SID and the Value. The value is the current ticker symbol while the SID is constant over the life of a security
QuantConnect.Symbol.Symbol | ( | SecurityIdentifier | sid, |
string | value | ||
) |
|
static |
Provides a convenience method for creating a Symbol for most security types. This method currently does not support Commodities
ticker | The string ticker symbol |
securityType | The security type of the ticker. If securityType == Option, then a canonical symbol is created |
market | The market the ticker resides in |
alias | An alias to be used for the symbol cache. Required when adding the same security from different markets |
baseDataType | Optional for SecurityType.Base and used for generating the base data SID |
Definition at line 64 of file Symbol.cs.
|
static |
Creates a new Symbol for custom data. This method allows for the creation of a new Base Symbol using the first ticker and the first traded date from the provided underlying Symbol. This avoids the issue for mappable types, where the ticker is remapped supposing the provided ticker value is from today. See SecurityIdentifier's private method GetFirstTickerAndDate. The provided symbol is also set to Symbol.Underlying so that it can be accessed using the custom data Symbol. This is useful for associating custom data Symbols to other asset classes so that it is possible to filter using custom data and place trades on the underlying asset based on the filtered custom data.
baseType | Type of BaseData instance |
underlying | Underlying symbol to set for the Base Symbol |
market | Market |
Definition at line 138 of file Symbol.cs.
|
static |
Creates a new Symbol for custom data. This method allows for the creation of a new Base Symbol using the first ticker and the first traded date from the provided underlying Symbol. This avoids the issue for mappable types, where the ticker is remapped supposing the provided ticker value is from today. See SecurityIdentifier's private method GetFirstTickerAndDate. The provided symbol is also set to Symbol.Underlying so that it can be accessed using the custom data Symbol. This is useful for associating custom data Symbols to other asset classes so that it is possible to filter using custom data and place trades on the underlying asset based on the filtered custom data.
baseType | Type of BaseData instance |
underlying | Underlying symbol to set for the Base Symbol |
market | Market |
Definition at line 156 of file Symbol.cs.
|
static |
Provides a convenience method for creating an option Symbol.
underlying | The underlying ticker |
market | The market the underlying resides in |
style | The option style (American, European, ect..) |
right | The option right (Put/Call) |
strike | The option strike price |
expiry | The option expiry date |
alias | An alias to be used for the symbol cache. Required when adding the same security from different markets |
mapSymbol | Specifies if symbol should be mapped using map file provider |
Definition at line 184 of file Symbol.cs.
|
static |
Provides a convenience method for creating an option Symbol using SecurityIdentifier.
underlyingSymbol | The underlying security symbol |
market | The market the underlying resides in |
style | The option style (American, European, ect..) |
right | The option right (Put/Call) |
strike | The option strike price |
expiry | The option expiry date |
alias | An alias to be used for the symbol cache. Required when adding the same security from diferent markets |
Definition at line 204 of file Symbol.cs.
|
static |
Provides a convenience method for creating an option Symbol using SecurityIdentifier.
underlyingSymbol | The underlying security symbol |
targetOption | The target option ticker. This is useful when the option ticker does not match the underlying, e.g. SPX index and the SPXW weekly option. If null is provided will use underlying |
market | The market the underlying resides in |
style | The option style (American, European, ect..) |
right | The option right (Put/Call) |
strike | The option strike price |
expiry | The option expiry date |
alias | An alias to be used for the symbol cache. Required when adding the same security from diferent markets |
Definition at line 222 of file Symbol.cs.
|
static |
Provides a convenience method for creating an option Symbol from its SecurityIdentifier and alias.
sid | The option SID |
value | The alias |
underlying | Optional underlying symbol to use. If null, it will we created from the given option SID and value |
Definition at line 236 of file Symbol.cs.
|
static |
Simple method to create the canonical option symbol for any given underlying symbol
underlyingSymbol | Underlying of this option |
market | Market for this option |
alias | An alias to be used for the symbol cache. Required when adding the same security from different markets |
Definition at line 275 of file Symbol.cs.
|
static |
Simple method to create the canonical option symbol for any given underlying symbol
underlyingSymbol | Underlying of this option |
targetOption | The target option ticker. This is useful when the option ticker does not match the underlying, e.g. SPX index and the SPXW weekly option. If null is provided will use underlying |
market | Market for this option |
alias | An alias to be used for the symbol cache. Required when adding the same security from different markets |
Definition at line 289 of file Symbol.cs.
|
static |
Provides a convenience method for creating a future Symbol.
ticker | The ticker |
market | The market the future resides in |
expiry | The future expiry date |
alias | An alias to be used for the symbol cache. Required when adding the same security from different markets |
Definition at line 314 of file Symbol.cs.
bool QuantConnect.Symbol.IsCanonical | ( | ) |
bool QuantConnect.Symbol.HasCanonical | ( | ) |
bool QuantConnect.Symbol.HasUnderlyingSymbol | ( | Symbol | symbol | ) |
Symbol QuantConnect.Symbol.UpdateMappedSymbol | ( | string | mappedSymbol, |
uint | contractDepthOffset = 0 |
||
) |
Creates new symbol with updated mapped symbol. Symbol Mapping: When symbols change over time (e.g. CHASE-> JPM) need to update the symbol requested. Method returns newly created symbol
Definition at line 483 of file Symbol.cs.
|
static |
Determines the SecurityType based on the underlying Symbol's SecurityType
underlyingSymbol | Underlying Symbol of an option |
ArgumentException | The provided underlying has no SecurityType able to represent it as an option |
Definition at line 544 of file Symbol.cs.
|
static |
Determines the SecurityType based on the underlying Symbol's SecurityType GetUnderlyingFromOptionType(SecurityType)
securityType | SecurityType of the underlying Symbol |
ArgumentException | The provided underlying has no SecurityType able to represent it as an option |
Definition at line 555 of file Symbol.cs.
|
static |
Determines the underlying SecurityType based on the option Symbol's SecurityType GetOptionTypeFromUnderlying(SecurityType)
securityType | SecurityType of the option Symbol |
ArgumentException | The provided option has no SecurityType able to represent it as an underlying |
Definition at line 576 of file Symbol.cs.
override bool QuantConnect.Symbol.Equals | ( | object | obj | ) |
Determines whether the specified T:System.Object is equal to the current T:System.Object.
obj | The object to compare with the current object. |
<filterpriority>2</filterpriority>
Definition at line 619 of file Symbol.cs.
override int QuantConnect.Symbol.GetHashCode | ( | ) |
int QuantConnect.Symbol.CompareTo | ( | object | obj | ) |
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
obj | An object to compare with this instance. |
T:System.ArgumentException | obj is not the same type as this instance. |
<filterpriority>2</filterpriority>
Definition at line 660 of file Symbol.cs.
override string QuantConnect.Symbol.ToString | ( | ) |
bool QuantConnect.Symbol.Equals | ( | Symbol | other | ) |
Indicates whether the current object is equal to another object of the same type.
other | An object to compare with this object. |
Definition at line 699 of file Symbol.cs.
|
static |
Equals operator
left | The left operand |
right | The right operand |
This is necessary in cases like Pythonnet passing a string as an object instead of using the implicit conversion
Definition at line 751 of file Symbol.cs.
|
static |
Equals operator
left | The left operand |
right | The right operand |
This is necessary in cases like Pythonnet passing a string as an object instead of using the implicit conversion
Definition at line 776 of file Symbol.cs.
|
static |
|
static |
|
static |
|
static |
|
static |
|
get |
|
get |
|
get |
|
get |
Gets whether or not this Symbol is a derivative, that is, it has a valid Underlying property
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |