Lean  $LEAN_TAG$
QuantConnect.Data.Market.OpenInterest Class Reference

Defines a data type that represents open interest for given security More...

Inheritance diagram for QuantConnect.Data.Market.OpenInterest:
[legend]

Public Member Functions

 OpenInterest ()
 Initializes a new instance of the OpenInterest class More...
 
 OpenInterest (OpenInterest original)
 Cloner constructor for fill forward engine implementation. Clone the original OI into this new one: More...
 
 OpenInterest (DateTime time, Symbol symbol, decimal openInterest)
 Initializes a new instance of the OpenInterest class with data More...
 
 OpenInterest (SubscriptionDataConfig config, Symbol symbol, string line, DateTime baseDate)
 Constructor for QuantConnect open interest data More...
 
 OpenInterest (SubscriptionDataConfig config, string line, DateTime date)
 Parse an open interest data line from quantconnect zip source files. More...
 
override BaseData Reader (SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)
 Tick implementation of reader method: read a line of data from the source and convert it to an open interest object. More...
 
override SubscriptionDataSource GetSource (SubscriptionDataConfig config, DateTime date, bool isLiveMode)
 Get source for OI data feed - not used with QuantConnect data sources implementation. More...
 
override BaseData Clone ()
 Clone implementation for open interest class: More...
 
- Public Member Functions inherited from QuantConnect.Data.Market.Tick
 Tick ()
 Initialize tick class with a default constructor. More...
 
 Tick (Tick original)
 Cloner constructor for fill forward engine implementation. Clone the original tick into this new tick: More...
 
 Tick (DateTime time, Symbol symbol, decimal bid, decimal ask)
 Constructor for a FOREX tick where there is no last sale price. The volume in FX is so high its rare to find FX trade data. To fake this the tick contains bid-ask prices and the last price is the midpoint. More...
 
 Tick (DateTime time, Symbol symbol, decimal openInterest)
 Initializes a new instance of the Tick class to TickType.OpenInterest. More...
 
 Tick (DateTime time, Symbol symbol, decimal last, decimal bid, decimal ask)
 Initializer for a last-trade equity tick with bid or ask prices. More...
 
 Tick (DateTime time, Symbol symbol, string saleCondition, string exchange, decimal quantity, decimal price)
 Trade tick type constructor More...
 
 Tick (DateTime time, Symbol symbol, string saleCondition, Exchange exchange, decimal quantity, decimal price)
 Trade tick type constructor More...
 
 Tick (DateTime time, Symbol symbol, string saleCondition, string exchange, decimal bidSize, decimal bidPrice, decimal askSize, decimal askPrice)
 Quote tick type constructor More...
 
 Tick (DateTime time, Symbol symbol, string saleCondition, Exchange exchange, decimal bidSize, decimal bidPrice, decimal askSize, decimal askPrice)
 Quote tick type constructor More...
 
 Tick (Symbol symbol, string line)
 Constructor for QuantConnect FXCM Data source: More...
 
 Tick (Symbol symbol, string line, DateTime baseDate)
 Constructor for QuantConnect tick data More...
 
 Tick (SubscriptionDataConfig config, StreamReader reader, DateTime date)
 Parse a tick data line from quantconnect zip source files. More...
 
 Tick (SubscriptionDataConfig config, string line, DateTime date)
 Parse a tick data line from quantconnect zip source files. More...
 
override BaseData Reader (SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)
 Tick implementation of reader method: read a line of data from the source and convert it to a tick object. More...
 
override BaseData Reader (SubscriptionDataConfig config, StreamReader stream, DateTime date, bool isLiveMode)
 Tick implementation of reader method: read a line of data from the source and convert it to a tick object. More...
 
override SubscriptionDataSource GetSource (SubscriptionDataConfig config, DateTime date, bool isLiveMode)
 Get source for tick data feed - not used with QuantConnect data sources implementation. More...
 
override void Update (decimal lastTrade, decimal bidPrice, decimal askPrice, decimal volume, decimal bidSize, decimal askSize)
 Update the tick price information - not used. More...
 
bool IsValid ()
 Check if tick contains valid data (either a trade, or a bid or ask) More...
 
override BaseData Clone ()
 Clone implementation for tick class: More...
 
override string ToString ()
 Formats a string with the symbol and value. More...
 
void SetValue ()
 Sets the tick Value based on ask and bid price More...
 
- Public Member Functions inherited from QuantConnect.Data.BaseData
 BaseData ()
 Constructor for initialising the dase data class More...
 
virtual bool RequiresMapping ()
 Indicates if there is support for mapping More...
 
virtual bool IsSparseData ()
 Indicates that the data set is expected to be sparse More...
 
virtual bool ShouldCacheToSecurity ()
 Indicates whether this contains data that should be stored in the security cache More...
 
virtual Resolution DefaultResolution ()
 Gets the default resolution for this data and security type More...
 
virtual List< ResolutionSupportedResolutions ()
 Gets the supported resolution for this data and security type More...
 
virtual DateTimeZone DataTimeZone ()
 Specifies the data time zone for this data type. This is useful for custom data types More...
 
void UpdateTrade (decimal lastTrade, decimal tradeSize)
 Updates this base data with a new trade More...
 
void UpdateQuote (decimal bidPrice, decimal bidSize, decimal askPrice, decimal askSize)
 Updates this base data with new quote information More...
 
void UpdateBid (decimal bidPrice, decimal bidSize)
 Updates this base data with the new quote bid information More...
 
void UpdateAsk (decimal askPrice, decimal askSize)
 Updates this base data with the new quote ask information More...
 
virtual BaseData Clone (bool fillForward)
 Return a new instance clone of this object, used in fill forward More...
 
override string ToString ()
 Formats a string with the symbol and value. More...
 
virtual BaseData Reader (SubscriptionDataConfig config, string line, DateTime date, DataFeedEndpoint dataFeed)
 Reader converts each line of the data source into BaseData objects. Each data type creates its own factory method, and returns a new instance of the object each time it is called. More...
 
virtual string GetSource (SubscriptionDataConfig config, DateTime date, DataFeedEndpoint datafeed)
 Return the URL string source of the file. This will be converted to a stream More...
 

Additional Inherited Members

- Static Public Member Functions inherited from QuantConnect.Data.BaseData
static IEnumerable< BaseDataDeserializeMessage (string serialized)
 Deserialize the message from the data server More...
 
- Public Attributes inherited from QuantConnect.Data.BaseData
virtual decimal Price => Value
 As this is a backtesting platform we'll provide an alias of value as price. More...
 
- Static Protected Attributes inherited from QuantConnect.Data.BaseData
static readonly List< ResolutionAllResolutions
 A list of all Resolution More...
 
static readonly List< ResolutionDailyResolution = new List<Resolution> { Resolution.Daily }
 A list of Resolution.Daily More...
 
static readonly List< ResolutionMinuteResolution = new List<Resolution> { Resolution.Minute }
 A list of Resolution.Minute More...
 
static readonly List< ResolutionHighResolution = new List<Resolution> { Resolution.Minute, Resolution.Second, Resolution.Tick }
 A list of high Resolution, including minute, second, and tick. More...
 
static readonly List< ResolutionOptionResolutions = new List<Resolution> { Resolution.Daily, Resolution.Hour, Resolution.Minute }
 A list of resolutions support by Options More...
 
- Properties inherited from QuantConnect.Data.Market.Tick
TickType TickType = TickType.Trade [get, set]
 Type of the Tick: Trade or Quote. More...
 
decimal Quantity [get, set]
 Quantity exchanged in a trade. More...
 
string? ExchangeCode [get, set]
 Exchange code this tick came from Exchanges More...
 
string? Exchange [get, set]
 Exchange name this tick came from Exchanges More...
 
string SaleCondition = string.Empty [get, set]
 Sale condition for the tick. More...
 
uint ParsedSaleCondition [get, set]
 For performance parsed sale condition for the tick. More...
 
bool Suspicious [get, set]
 Bool whether this is a suspicious tick More...
 
decimal BidPrice [get, set]
 Bid Price for Tick More...
 
decimal AskPrice [get, set]
 Asking price for the Tick quote. More...
 
decimal LastPrice [get]
 Alias for "Value" - the last sale for this asset. More...
 
decimal BidSize [get, set]
 Size of bid quote. More...
 
decimal AskSize [get, set]
 Size of ask quote. More...
 
- Properties inherited from QuantConnect.Data.BaseData
MarketDataType DataType = MarketDataType.Base [get, set]
 Market Data Type of this data - does it come in individual price packets or is it grouped into OHLC. More...
 
bool IsFillForward [get]
 True if this is a fill forward piece of data More...
 
DateTime Time [get, set]
 Current time marker of this data packet. More...
 
virtual DateTime EndTime [get, set]
 The end time of this data. Some data covers spans (trade bars) and as such we want to know the entire time span covered More...
 
Symbol Symbol = Symbol.Empty [get, set]
 Symbol representation for underlying Security More...
 
virtual decimal Value [get, set]
 Value representation of this data packet. All data requires a representative value for this moment in time. For streams of data this is the price now, for OHLC packets this is the closing price. More...
 
- Properties inherited from QuantConnect.Data.IBaseData
MarketDataType DataType [get, set]
 Market Data Type of this data - does it come in individual price packets or is it grouped into OHLC. More...
 
DateTime Time [get, set]
 Time keeper of data – all data is timeseries based. More...
 
DateTime EndTime [get, set]
 End time of data More...
 
decimal Value [get, set]
 All timeseries data is a time-value pair: More...
 
decimal Price [get]
 Alias of Value. More...
 
- Properties inherited from QuantConnect.Data.ISymbolProvider
Symbol Symbol [get, set]
 Gets the Symbol More...
 

Detailed Description

Defines a data type that represents open interest for given security

Definition at line 27 of file OpenInterest.cs.

Constructor & Destructor Documentation

◆ OpenInterest() [1/5]

QuantConnect.Data.Market.OpenInterest.OpenInterest ( )

Initializes a new instance of the OpenInterest class

Definition at line 32 of file OpenInterest.cs.

Here is the caller graph for this function:

◆ OpenInterest() [2/5]

QuantConnect.Data.Market.OpenInterest.OpenInterest ( OpenInterest  original)

Cloner constructor for fill forward engine implementation. Clone the original OI into this new one:

Parameters
originalOriginal OI we're cloning

Definition at line 45 of file OpenInterest.cs.

◆ OpenInterest() [3/5]

QuantConnect.Data.Market.OpenInterest.OpenInterest ( DateTime  time,
Symbol  symbol,
decimal  openInterest 
)

Initializes a new instance of the OpenInterest class with data

Parameters
timeFull date and time
symbolUnderlying equity security symbol
openInterestOpen Interest value

Definition at line 60 of file OpenInterest.cs.

◆ OpenInterest() [4/5]

QuantConnect.Data.Market.OpenInterest.OpenInterest ( SubscriptionDataConfig  config,
Symbol  symbol,
string  line,
DateTime  baseDate 
)

Constructor for QuantConnect open interest data

Parameters
configSubscription configuration
symbolSymbol for underlying asset
lineCSV line of data from QC OI csv
baseDateThe base date of the OI

Definition at line 76 of file OpenInterest.cs.

◆ OpenInterest() [5/5]

QuantConnect.Data.Market.OpenInterest.OpenInterest ( SubscriptionDataConfig  config,
string  line,
DateTime  date 
)

Parse an open interest data line from quantconnect zip source files.

Parameters
lineCSV source line of the compressed source
dateBase date for the open interest (date is stored as int milliseconds since midnight)
configSubscription configuration object

Definition at line 101 of file OpenInterest.cs.

Member Function Documentation

◆ Reader()

override BaseData QuantConnect.Data.Market.OpenInterest.Reader ( SubscriptionDataConfig  config,
string  line,
DateTime  date,
bool  isLiveMode 
)
virtual

Tick implementation of reader method: read a line of data from the source and convert it to an open interest object.

Parameters
configSubscription configuration object for algorithm
lineLine from the datafeed source
dateDate of this reader request
isLiveModetrue if we're in live mode, false for backtesting mode
Returns
New initialized open interest object

Reimplemented from QuantConnect.Data.BaseData.

Definition at line 114 of file OpenInterest.cs.

Here is the call graph for this function:

◆ GetSource()

override SubscriptionDataSource QuantConnect.Data.Market.OpenInterest.GetSource ( SubscriptionDataConfig  config,
DateTime  date,
bool  isLiveMode 
)
virtual

Get source for OI data feed - not used with QuantConnect data sources implementation.

Parameters
configConfiguration object
dateDate of this source request if source spread across multiple files
isLiveModetrue if we're in live mode, false for backtesting mode
Returns
String source location of the file to be opened with a stream

Reimplemented from QuantConnect.Data.BaseData.

Definition at line 132 of file OpenInterest.cs.

Here is the call graph for this function:

◆ Clone()

override BaseData QuantConnect.Data.Market.OpenInterest.Clone ( )
virtual

Clone implementation for open interest class:

Returns
New tick object clone of the current class values.

Reimplemented from QuantConnect.Data.BaseData.

Definition at line 152 of file OpenInterest.cs.

Here is the call graph for this function:

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