Lean  $LEAN_TAG$
QuantConnect.Lean.Engine.DataFeeds.Queues.FakeDataQueue Class Reference

This is an implementation of IDataQueueHandler used for testing. FakeHistoryProvider More...

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

Public Member Functions

 FakeDataQueue ()
 Initializes a new instance of the FakeDataQueue class to randomly emit data for each symbol More...
 
 FakeDataQueue (IDataAggregator dataAggregator, int dataPointsPerSecondPerSymbol=500000)
 Initializes a new instance of the FakeDataQueue class to randomly emit data for each symbol More...
 
IEnumerator< BaseDataSubscribe (SubscriptionDataConfig dataConfig, EventHandler newDataAvailableHandler)
 Subscribe to the specified configuration More...
 
void SetJob (LiveNodePacket job)
 Sets the job we're subscribing for More...
 
void Unsubscribe (SubscriptionDataConfig dataConfig)
 Removes the specified configuration More...
 
void Dispose ()
 Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. More...
 
IEnumerable< SymbolLookupSymbols (Symbol symbol, bool includeExpired, string securityCurrency=null)
 Method returns a collection of Symbols that are available at the data source. More...
 
bool CanPerformSelection ()
 Returns whether selection can take place or not. More...
 

Public Attributes

bool IsConnected => true
 Returns whether the data provider is connected More...
 

Properties

virtual ITimeProvider TimeProvider = RealTimeProvider.Instance [get]
 Continuous UTC time provider More...
 
- Properties inherited from QuantConnect.Interfaces.IDataQueueHandler
bool IsConnected [get]
 Returns whether the data provider is connected More...
 

Detailed Description

This is an implementation of IDataQueueHandler used for testing. FakeHistoryProvider

Definition at line 34 of file FakeDataQueue.cs.

Constructor & Destructor Documentation

◆ FakeDataQueue() [1/2]

QuantConnect.Lean.Engine.DataFeeds.Queues.FakeDataQueue.FakeDataQueue ( )

Initializes a new instance of the FakeDataQueue class to randomly emit data for each symbol

Definition at line 57 of file FakeDataQueue.cs.

◆ FakeDataQueue() [2/2]

QuantConnect.Lean.Engine.DataFeeds.Queues.FakeDataQueue.FakeDataQueue ( IDataAggregator  dataAggregator,
int  dataPointsPerSecondPerSymbol = 500000 
)

Initializes a new instance of the FakeDataQueue class to randomly emit data for each symbol

Definition at line 66 of file FakeDataQueue.cs.

Here is the call graph for this function:

Member Function Documentation

◆ Subscribe()

IEnumerator<BaseData> QuantConnect.Lean.Engine.DataFeeds.Queues.FakeDataQueue.Subscribe ( SubscriptionDataConfig  dataConfig,
EventHandler  newDataAvailableHandler 
)

Subscribe to the specified configuration

Parameters
dataConfigdefines the parameters to subscribe to a data feed
newDataAvailableHandlerhandler to be fired on new data available
Returns
The new enumerator for this subscription request

Implements QuantConnect.Interfaces.IDataQueueHandler.

Definition at line 113 of file FakeDataQueue.cs.

◆ SetJob()

void QuantConnect.Lean.Engine.DataFeeds.Queues.FakeDataQueue.SetJob ( LiveNodePacket  job)

Sets the job we're subscribing for

Parameters
jobJob we're subscribing for

Implements QuantConnect.Interfaces.IDataQueueHandler.

Definition at line 125 of file FakeDataQueue.cs.

◆ Unsubscribe()

void QuantConnect.Lean.Engine.DataFeeds.Queues.FakeDataQueue.Unsubscribe ( SubscriptionDataConfig  dataConfig)

Removes the specified configuration

Parameters
dataConfigSubscription config to be removed

Implements QuantConnect.Interfaces.IDataQueueHandler.

Definition at line 133 of file FakeDataQueue.cs.

◆ Dispose()

void QuantConnect.Lean.Engine.DataFeeds.Queues.FakeDataQueue.Dispose ( )

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

Definition at line 148 of file FakeDataQueue.cs.

◆ LookupSymbols()

IEnumerable<Symbol> QuantConnect.Lean.Engine.DataFeeds.Queues.FakeDataQueue.LookupSymbols ( Symbol  symbol,
bool  includeExpired,
string  securityCurrency = null 
)

Method returns a collection of Symbols that are available at the data source.

Parameters
symbolSymbol to lookup
includeExpiredInclude expired contracts
securityCurrencyExpected security currency(if any)
Returns
Enumerable of Symbols, that are associated with the provided Symbol

Implements QuantConnect.Interfaces.IDataQueueUniverseProvider.

Definition at line 224 of file FakeDataQueue.cs.

◆ CanPerformSelection()

bool QuantConnect.Lean.Engine.DataFeeds.Queues.FakeDataQueue.CanPerformSelection ( )

Returns whether selection can take place or not.

This is useful to avoid a selection taking place during invalid times, for example IB reset times or when not connected, because if allowed selection would fail since IB isn't running and would kill the algorithm

Returns
True if selection can take place

Implements QuantConnect.Interfaces.IDataQueueUniverseProvider.

Definition at line 241 of file FakeDataQueue.cs.

Member Data Documentation

◆ IsConnected

bool QuantConnect.Lean.Engine.DataFeeds.Queues.FakeDataQueue.IsConnected => true

Returns whether the data provider is connected

Returns
true if the data provider is connected

Definition at line 143 of file FakeDataQueue.cs.

Property Documentation

◆ TimeProvider

virtual ITimeProvider QuantConnect.Lean.Engine.DataFeeds.Queues.FakeDataQueue.TimeProvider = RealTimeProvider.Instance
getprotected

Continuous UTC time provider

Definition at line 51 of file FakeDataQueue.cs.


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