Lean  $LEAN_TAG$
QuantConnect.SymbolRepresentation Class Reference

Public static helper class that does parsing/generation of symbol representations (options, futures) More...

Classes

class  FutureTickerProperties
 Class contains future ticker properties returned by ParseFutureTicker() More...
 
class  OptionTickerProperties
 Class contains option ticker properties returned by ParseOptionTickerIQFeed() More...
 

Static Public Member Functions

static FutureTickerProperties ParseFutureTicker (string ticker)
 Function returns underlying name, expiration year, expiration month, expiration day for the future contract ticker. Function detects if the format used is either 1 or 2 digits year, and if day code is present (will default to 1rst day of month). Returns null, if parsing failed. Format [Ticker][2 digit day code OPTIONAL][1 char month code][2/1 digit year code] More...
 
static Symbol ParseFutureSymbol (string ticker, int? futureYear=null)
 Helper method to parse and generate a future symbol from a given user friendly representation More...
 
static Symbol ParseFutureOptionSymbol (string ticker, int strikeScale=1)
 Creates a future option Symbol from the provided ticker More...
 
static string GenerateFutureTicker (string underlying, DateTime expiration, bool doubleDigitsYear=true, bool includeExpirationDate=true)
 Returns future symbol ticker from underlying and expiration date. Function can generate tickers of two formats: one and two digits year. Format [Ticker][2 digit day code][1 char month code][2/1 digit year code], more information at http://help.tradestation.com/09_01/tradestationhelp/symbology/futures_symbology.htm More...
 
static string GenerateOptionTickerOSI (this Symbol symbol)
 Returns option symbol ticker in accordance with OSI symbology More information can be found at http://www.optionsclearing.com/components/docs/initiatives/symbology/symbology_initiative_v1_8.pdf More...
 
static string GenerateOptionTickerOSI (string underlying, OptionRight right, decimal strikePrice, DateTime expiration)
 Returns option symbol ticker in accordance with OSI symbology More information can be found at http://www.optionsclearing.com/components/docs/initiatives/symbology/symbology_initiative_v1_8.pdf More...
 
static string GenerateOptionTickerOSICompact (this Symbol symbol)
 Returns option symbol ticker in accordance with OSI symbology More information can be found at http://www.optionsclearing.com/components/docs/initiatives/symbology/symbology_initiative_v1_8.pdf More...
 
static string GenerateOptionTickerOSICompact (string underlying, OptionRight right, decimal strikePrice, DateTime expiration)
 Returns option symbol ticker in accordance with OSI symbology More information can be found at http://www.optionsclearing.com/components/docs/initiatives/symbology/symbology_initiative_v1_8.pdf More...
 
static Symbol ParseOptionTickerOSI (string ticker, SecurityType securityType=SecurityType.Option, string market=Market.USA)
 Parses the specified OSI options ticker into a Symbol object More...
 
static Symbol ParseOptionTickerOSI (string ticker, SecurityType securityType, OptionStyle optionStyle, string market)
 Parses the specified OSI options ticker into a Symbol object More...
 
static bool TryDecomposeOptionTickerOSI (string ticker, out string optionTicker, out DateTime expiry, out OptionRight right, out decimal strike)
 Tries to decompose the specified OSI options ticker into its components More...
 
static bool TryDecomposeOptionTickerOSI (string ticker, SecurityType securityType, out string optionTicker, out string underlyingTicker, out DateTime expiry, out OptionRight right, out decimal strike)
 Tries to decompose the specified OSI options ticker into its components More...
 
static string GenerateOptionTicker (Symbol symbol)
 Function returns option ticker from IQFeed option ticker For example CSCO1220V19 Cisco October Put at 19.00 Expiring on 10/20/12 Symbology details: http://www.iqfeed.net/symbolguide/index.cfm?symbolguide=guide&displayaction=support%C2%A7ion=guide&web=iqfeed&guide=options&web=IQFeed&type=stock More...
 
static OptionTickerProperties ParseOptionTickerIQFeed (string ticker)
 Function returns option contract parameters (underlying name, expiration date, strike, right) from IQFeed option ticker Symbology details: http://www.iqfeed.net/symbolguide/index.cfm?symbolguide=guide&displayaction=support%C2%A7ion=guide&web=iqfeed&guide=options&web=IQFeed&type=stock More...
 

Properties

static IReadOnlyDictionary< string, int > FuturesMonthCodeLookup [get]
 Provides a lookup dictionary for mapping futures month codes to their corresponding numeric values. More...
 
static IReadOnlyDictionary< int, string > FuturesMonthLookup = FuturesMonthCodeLookup.ToDictionary(kv => kv.Value, kv => kv.Key) [get]
 Provides a lookup dictionary for mapping numeric values to their corresponding futures month codes. More...
 

Detailed Description

Public static helper class that does parsing/generation of symbol representations (options, futures)

Definition at line 34 of file SymbolRepresentation.cs.

Member Function Documentation

◆ ParseFutureTicker()

static FutureTickerProperties QuantConnect.SymbolRepresentation.ParseFutureTicker ( string  ticker)
static

Function returns underlying name, expiration year, expiration month, expiration day for the future contract ticker. Function detects if the format used is either 1 or 2 digits year, and if day code is present (will default to 1rst day of month). Returns null, if parsing failed. Format [Ticker][2 digit day code OPTIONAL][1 char month code][2/1 digit year code]

Parameters
ticker
Returns
Results containing 1) underlying name, 2) short expiration year, 3) expiration month

Definition at line 104 of file SymbolRepresentation.cs.

Here is the caller graph for this function:

◆ ParseFutureSymbol()

static Symbol QuantConnect.SymbolRepresentation.ParseFutureSymbol ( string  ticker,
int?  futureYear = null 
)
static

Helper method to parse and generate a future symbol from a given user friendly representation

Parameters
tickerThe future ticker, for example 'ESZ1'
futureYearClarifies the year for the current future
Returns
The future symbol or null if failed

Definition at line 156 of file SymbolRepresentation.cs.

Here is the call graph for this function:

◆ ParseFutureOptionSymbol()

static Symbol QuantConnect.SymbolRepresentation.ParseFutureOptionSymbol ( string  ticker,
int  strikeScale = 1 
)
static

Creates a future option Symbol from the provided ticker

Parameters
tickerThe future option ticker, for example 'ESZ0 P3590'
strikeScaleOptional the future option strike scale factor

Definition at line 186 of file SymbolRepresentation.cs.

Here is the call graph for this function:

◆ GenerateFutureTicker()

static string QuantConnect.SymbolRepresentation.GenerateFutureTicker ( string  underlying,
DateTime  expiration,
bool  doubleDigitsYear = true,
bool  includeExpirationDate = true 
)
static

Returns future symbol ticker from underlying and expiration date. Function can generate tickers of two formats: one and two digits year. Format [Ticker][2 digit day code][1 char month code][2/1 digit year code], more information at http://help.tradestation.com/09_01/tradestationhelp/symbology/futures_symbology.htm

Parameters
underlyingString underlying
expirationExpiration date
doubleDigitsYearTrue if year should represented by two digits; False - one digit
includeExpirationDateTrue if expiration date should be included
Returns
The user friendly future ticker

Definition at line 256 of file SymbolRepresentation.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GenerateOptionTickerOSI() [1/2]

static string QuantConnect.SymbolRepresentation.GenerateOptionTickerOSI ( this Symbol  symbol)
static

Returns option symbol ticker in accordance with OSI symbology More information can be found at http://www.optionsclearing.com/components/docs/initiatives/symbology/symbology_initiative_v1_8.pdf

Parameters
symbolSymbol object to create OSI ticker from
Returns
The OSI ticker representation

Definition at line 298 of file SymbolRepresentation.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GenerateOptionTickerOSI() [2/2]

static string QuantConnect.SymbolRepresentation.GenerateOptionTickerOSI ( string  underlying,
OptionRight  right,
decimal  strikePrice,
DateTime  expiration 
)
static

Returns option symbol ticker in accordance with OSI symbology More information can be found at http://www.optionsclearing.com/components/docs/initiatives/symbology/symbology_initiative_v1_8.pdf

Parameters
underlyingUnderlying string
rightOption right
strikePriceOption strike
expirationOption expiration date
Returns
The OSI ticker representation

Definition at line 318 of file SymbolRepresentation.cs.

◆ GenerateOptionTickerOSICompact() [1/2]

static string QuantConnect.SymbolRepresentation.GenerateOptionTickerOSICompact ( this Symbol  symbol)
static

Returns option symbol ticker in accordance with OSI symbology More information can be found at http://www.optionsclearing.com/components/docs/initiatives/symbology/symbology_initiative_v1_8.pdf

Parameters
symbolSymbol object to create OSI ticker from
Returns
The OSI ticker representation

Definition at line 330 of file SymbolRepresentation.cs.

Here is the call graph for this function:

◆ GenerateOptionTickerOSICompact() [2/2]

static string QuantConnect.SymbolRepresentation.GenerateOptionTickerOSICompact ( string  underlying,
OptionRight  right,
decimal  strikePrice,
DateTime  expiration 
)
static

Returns option symbol ticker in accordance with OSI symbology More information can be found at http://www.optionsclearing.com/components/docs/initiatives/symbology/symbology_initiative_v1_8.pdf

Parameters
underlyingUnderlying string
rightOption right
strikePriceOption strike
expirationOption expiration date
Returns
The OSI ticker representation

Definition at line 350 of file SymbolRepresentation.cs.

◆ ParseOptionTickerOSI() [1/2]

static Symbol QuantConnect.SymbolRepresentation.ParseOptionTickerOSI ( string  ticker,
SecurityType  securityType = SecurityType.Option,
string  market = Market.USA 
)
static

Parses the specified OSI options ticker into a Symbol object

Parameters
tickerThe OSI compliant option ticker string
securityTypeThe security type
marketThe associated market
Returns
Symbol object for the specified OSI option ticker string

Definition at line 362 of file SymbolRepresentation.cs.

◆ ParseOptionTickerOSI() [2/2]

static Symbol QuantConnect.SymbolRepresentation.ParseOptionTickerOSI ( string  ticker,
SecurityType  securityType,
OptionStyle  optionStyle,
string  market 
)
static

Parses the specified OSI options ticker into a Symbol object

Parameters
tickerThe OSI compliant option ticker string
securityTypeThe security type
marketThe associated market
optionStyleThe option style
Returns
Symbol object for the specified OSI option ticker string

Definition at line 375 of file SymbolRepresentation.cs.

Here is the call graph for this function:

◆ TryDecomposeOptionTickerOSI() [1/2]

static bool QuantConnect.SymbolRepresentation.TryDecomposeOptionTickerOSI ( string  ticker,
out string  optionTicker,
out DateTime  expiry,
out OptionRight  right,
out decimal  strike 
)
static

Tries to decompose the specified OSI options ticker into its components

Parameters
tickerThe OSI option ticker
optionTickerThe option ticker extracted from the OSI symbol
expiryThe option contract expiry date
rightThe option contract right
strikeThe option contract strike price
Returns
True if the OSI symbol was in the right format and could be decomposed

Definition at line 414 of file SymbolRepresentation.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TryDecomposeOptionTickerOSI() [2/2]

static bool QuantConnect.SymbolRepresentation.TryDecomposeOptionTickerOSI ( string  ticker,
SecurityType  securityType,
out string  optionTicker,
out string  underlyingTicker,
out DateTime  expiry,
out OptionRight  right,
out decimal  strike 
)
static

Tries to decompose the specified OSI options ticker into its components

Parameters
tickerThe OSI option ticker
securityTypeThe option security type
optionTickerThe option ticker extracted from the OSI symbol
underlyingTickerThe underlying ticker
expiryThe option contract expiry date
rightThe option contract right
strikeThe option contract strike price
Returns
True if the OSI symbol was in the right format and could be decomposed

Definition at line 452 of file SymbolRepresentation.cs.

Here is the call graph for this function:

◆ GenerateOptionTicker()

static string QuantConnect.SymbolRepresentation.GenerateOptionTicker ( Symbol  symbol)
static

Function returns option ticker from IQFeed option ticker For example CSCO1220V19 Cisco October Put at 19.00 Expiring on 10/20/12 Symbology details: http://www.iqfeed.net/symbolguide/index.cfm?symbolguide=guide&amp;displayaction=support%C2%A7ion=guide&amp;web=iqfeed&amp;guide=options&amp;web=IQFeed&amp;type=stock

Parameters
symbolTHe option symbol
Returns
The option ticker

Definition at line 479 of file SymbolRepresentation.cs.

Here is the caller graph for this function:

◆ ParseOptionTickerIQFeed()

static OptionTickerProperties QuantConnect.SymbolRepresentation.ParseOptionTickerIQFeed ( string  ticker)
static

Function returns option contract parameters (underlying name, expiration date, strike, right) from IQFeed option ticker Symbology details: http://www.iqfeed.net/symbolguide/index.cfm?symbolguide=guide&amp;displayaction=support%C2%A7ion=guide&amp;web=iqfeed&amp;guide=options&amp;web=IQFeed&amp;type=stock

Parameters
tickerIQFeed option ticker
Returns
Results containing 1) underlying name, 2) option right, 3) option strike 4) expiration date

Definition at line 492 of file SymbolRepresentation.cs.

Property Documentation

◆ FuturesMonthCodeLookup

IReadOnlyDictionary<string, int> QuantConnect.SymbolRepresentation.FuturesMonthCodeLookup
staticget
Initial value:
= new Dictionary<string, int>
{
{ "F", 1 },
{ "G", 2 },
{ "H", 3 },
{ "J", 4 },
{ "K", 5 },
{ "M", 6 },
{ "N", 7 },
{ "Q", 8 },
{ "U", 9 },
{ "V", 10 },
{ "X", 11 },
{ "Z", 12 }
}

Provides a lookup dictionary for mapping futures month codes to their corresponding numeric values.

Definition at line 563 of file SymbolRepresentation.cs.

◆ FuturesMonthLookup

IReadOnlyDictionary<int, string> QuantConnect.SymbolRepresentation.FuturesMonthLookup = FuturesMonthCodeLookup.ToDictionary(kv => kv.Value, kv => kv.Key)
staticget

Provides a lookup dictionary for mapping numeric values to their corresponding futures month codes.

Definition at line 582 of file SymbolRepresentation.cs.


The documentation for this class was generated from the following file: