Lean  $LEAN_TAG$
QuantConnect.Lean.Engine.DataFeeds.Subscription Class Reference

Represents the data required for a data feed to process a single subscription More...

Inheritance diagram for QuantConnect.Lean.Engine.DataFeeds.Subscription:
[legend]

Public Member Functions

 Subscription (SubscriptionRequest subscriptionRequest, IEnumerator< SubscriptionData > enumerator, TimeZoneOffsetProvider timeZoneOffsetProvider)
 Initializes a new instance of the Subscription class with a universe More...
 
bool AddSubscriptionRequest (SubscriptionRequest subscriptionRequest)
 Adds a SubscriptionRequest for this subscription More...
 
bool RemoveSubscriptionRequest (Universe universe=null)
 Removes one or all SubscriptionRequest from this subscription More...
 
virtual bool MoveNext ()
 Advances the enumerator to the next element of the collection. More...
 
void Reset ()
 Sets the enumerator to its initial position, which is before the first element in the collection. More...
 
void Dispose ()
 Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. More...
 
void MarkAsRemovedFromUniverse ()
 Mark this subscription as having been removed from the universe. Data for this time step will be discarded. More...
 
override int GetHashCode ()
 Serves as a hash function for a particular type. More...
 
override bool Equals (object obj)
 Determines whether the specified object is equal to the current object. More...
 
override string ToString ()
 Returns a string that represents the current object. More...
 
void OnNewDataAvailable ()
 Event invocator for the NewDataAvailable event More...
 

Public Attributes

IEnumerable< UniverseUniverses
 Gets the universe for this subscription More...
 

Properties

ISecurityPrice Security [get]
 Gets the security this subscription points to More...
 
SubscriptionDataConfig Configuration [get]
 Gets the configuration for this subscritions More...
 
DateTimeZone TimeZone [get]
 Gets the exchange time zone associated with this subscription More...
 
TimeZoneOffsetProvider OffsetProvider [get]
 Gets the offset provider for time zone conversions to and from the data's local time More...
 
decimal RealtimePrice [get, set]
 Gets the most current value from the subscription source More...
 
bool EndOfStream [get]
 Gets true if this subscription is finished, false otherwise More...
 
bool IsUniverseSelectionSubscription [get]
 Gets true if this subscription is used in universe selection More...
 
DateTime UtcStartTime [get]
 Gets the start time of this subscription in UTC More...
 
DateTime UtcEndTime [get]
 Gets the end time of this subscription in UTC More...
 
IReadOnlyRef< bool > RemovedFromUniverse [get]
 Gets whether or not this subscription has been removed from its parent universe More...
 
SubscriptionData Current [get]
 Gets the element in the collection at the current position of the enumerator. More...
 

Events

EventHandler NewDataAvailable
 Event fired when a new data point is available More...
 

Detailed Description

Represents the data required for a data feed to process a single subscription

Definition at line 32 of file Subscription.cs.

Constructor & Destructor Documentation

◆ Subscription()

QuantConnect.Lean.Engine.DataFeeds.Subscription.Subscription ( SubscriptionRequest  subscriptionRequest,
IEnumerator< SubscriptionData enumerator,
TimeZoneOffsetProvider  timeZoneOffsetProvider 
)

Initializes a new instance of the Subscription class with a universe

Parameters
subscriptionRequestSpecified for universe subscriptions
enumeratorThe subscription's data source
timeZoneOffsetProviderThe offset provider used to convert data local times to utc

Definition at line 110 of file Subscription.cs.

Here is the caller graph for this function:

Member Function Documentation

◆ AddSubscriptionRequest()

bool QuantConnect.Lean.Engine.DataFeeds.Subscription.AddSubscriptionRequest ( SubscriptionRequest  subscriptionRequest)

Adds a SubscriptionRequest for this subscription

Parameters
subscriptionRequestThe SubscriptionRequest to add

Definition at line 132 of file Subscription.cs.

Here is the caller graph for this function:

◆ RemoveSubscriptionRequest()

bool QuantConnect.Lean.Engine.DataFeeds.Subscription.RemoveSubscriptionRequest ( Universe  universe = null)

Removes one or all SubscriptionRequest from this subscription

Parameters
universeUniverse requesting to remove SubscriptionRequest. Default value, null, will remove all universes
Returns
True, if the subscription is empty and ready to be removed

Definition at line 164 of file Subscription.cs.

Here is the call graph for this function:

◆ MoveNext()

virtual bool QuantConnect.Lean.Engine.DataFeeds.Subscription.MoveNext ( )
virtual

Advances the enumerator to the next element of the collection.

Returns
true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.
Exceptions
T:System.InvalidOperationExceptionThe collection was modified after the enumerator was created.

<filterpriority>2</filterpriority>

Definition at line 203 of file Subscription.cs.

◆ Reset()

void QuantConnect.Lean.Engine.DataFeeds.Subscription.Reset ( )

Sets the enumerator to its initial position, which is before the first element in the collection.

Exceptions
T:System.InvalidOperationExceptionThe collection was modified after the enumerator was created.

<filterpriority>2</filterpriority>

Definition at line 220 of file Subscription.cs.

◆ Dispose()

void QuantConnect.Lean.Engine.DataFeeds.Subscription.Dispose ( )

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

<filterpriority>2</filterpriority>

Definition at line 246 of file Subscription.cs.

◆ MarkAsRemovedFromUniverse()

void QuantConnect.Lean.Engine.DataFeeds.Subscription.MarkAsRemovedFromUniverse ( )

Mark this subscription as having been removed from the universe. Data for this time step will be discarded.

Definition at line 256 of file Subscription.cs.

Here is the caller graph for this function:

◆ GetHashCode()

override int QuantConnect.Lean.Engine.DataFeeds.Subscription.GetHashCode ( )

Serves as a hash function for a particular type.

Returns
A hash code for the current T:System.Object.

<filterpriority>2</filterpriority>

Definition at line 268 of file Subscription.cs.

Here is the call graph for this function:

◆ Equals()

override bool QuantConnect.Lean.Engine.DataFeeds.Subscription.Equals ( object  obj)

Determines whether the specified object is equal to the current object.

Parameters
objThe object to compare with the current object.
Returns
true if the specified object is equal to the current object; otherwise, false.

Definition at line 277 of file Subscription.cs.

Here is the call graph for this function:

◆ ToString()

override string QuantConnect.Lean.Engine.DataFeeds.Subscription.ToString ( )

Returns a string that represents the current object.

Returns
A string that represents the current object.

<filterpriority>2</filterpriority>

Definition at line 291 of file Subscription.cs.

Here is the call graph for this function:

◆ OnNewDataAvailable()

void QuantConnect.Lean.Engine.DataFeeds.Subscription.OnNewDataAvailable ( )

Event invocator for the NewDataAvailable event

Definition at line 299 of file Subscription.cs.

Member Data Documentation

◆ Universes

IEnumerable<Universe> QuantConnect.Lean.Engine.DataFeeds.Subscription.Universes
Initial value:
=> SubscriptionRequests
.Where(x => x.Universe != null)
.Select(x => x.Universe)

Gets the universe for this subscription

Definition at line 50 of file Subscription.cs.

Property Documentation

◆ Security

ISecurityPrice QuantConnect.Lean.Engine.DataFeeds.Subscription.Security
get

Gets the security this subscription points to

Definition at line 57 of file Subscription.cs.

◆ Configuration

SubscriptionDataConfig QuantConnect.Lean.Engine.DataFeeds.Subscription.Configuration
get

Gets the configuration for this subscritions

Definition at line 62 of file Subscription.cs.

◆ TimeZone

DateTimeZone QuantConnect.Lean.Engine.DataFeeds.Subscription.TimeZone
get

Gets the exchange time zone associated with this subscription

Definition at line 67 of file Subscription.cs.

◆ OffsetProvider

TimeZoneOffsetProvider QuantConnect.Lean.Engine.DataFeeds.Subscription.OffsetProvider
get

Gets the offset provider for time zone conversions to and from the data's local time

Definition at line 72 of file Subscription.cs.

◆ RealtimePrice

decimal QuantConnect.Lean.Engine.DataFeeds.Subscription.RealtimePrice
getset

Gets the most current value from the subscription source

Definition at line 77 of file Subscription.cs.

◆ EndOfStream

bool QuantConnect.Lean.Engine.DataFeeds.Subscription.EndOfStream
get

Gets true if this subscription is finished, false otherwise

Definition at line 82 of file Subscription.cs.

◆ IsUniverseSelectionSubscription

bool QuantConnect.Lean.Engine.DataFeeds.Subscription.IsUniverseSelectionSubscription
get

Gets true if this subscription is used in universe selection

Definition at line 87 of file Subscription.cs.

◆ UtcStartTime

DateTime QuantConnect.Lean.Engine.DataFeeds.Subscription.UtcStartTime
get

Gets the start time of this subscription in UTC

Definition at line 92 of file Subscription.cs.

◆ UtcEndTime

DateTime QuantConnect.Lean.Engine.DataFeeds.Subscription.UtcEndTime
get

Gets the end time of this subscription in UTC

Definition at line 97 of file Subscription.cs.

◆ RemovedFromUniverse

IReadOnlyRef<bool> QuantConnect.Lean.Engine.DataFeeds.Subscription.RemovedFromUniverse
get

Gets whether or not this subscription has been removed from its parent universe

Definition at line 102 of file Subscription.cs.

◆ Current

SubscriptionData QuantConnect.Lean.Engine.DataFeeds.Subscription.Current
get

Gets the element in the collection at the current position of the enumerator.

Returns
The element in the collection at the current position of the enumerator.

Definition at line 231 of file Subscription.cs.

Event Documentation

◆ NewDataAvailable

EventHandler QuantConnect.Lean.Engine.DataFeeds.Subscription.NewDataAvailable

Event fired when a new data point is available

Definition at line 45 of file Subscription.cs.


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