Lean
$LEAN_TAG$
|
Live trading realtime event processing. More...
Public Member Functions | |
override void | Setup (IAlgorithm algorithm, AlgorithmNodePacket job, IResultHandler resultHandler, IApi api, IIsolatorLimitResultProvider isolatorLimitProvider) |
Initializes the real time handler for the specified algorithm and job More... | |
override void | SetTime (DateTime time) |
Set the current time. If the date changes re-start the realtime event setup routines. More... | |
override void | ScanPastEvents (DateTime time) |
Scan for past events that didn't fire because there was no data at the scheduled time. More... | |
override void | Exit () |
Stop the real time thread More... | |
Public Member Functions inherited from QuantConnect.Lean.Engine.RealTime.BacktestingRealTimeHandler | |
override void | Add (ScheduledEvent scheduledEvent) |
Adds the specified event to the schedule More... | |
override void | Remove (ScheduledEvent scheduledEvent) |
Removes the specified event from the schedule More... | |
Public Member Functions inherited from QuantConnect.Lean.Engine.RealTime.BaseRealTimeHandler | |
void | OnSecuritiesChanged (SecurityChanges changes) |
Event fired each time that we add/remove securities from the data feed More... | |
Protected Member Functions | |
override int | GetTimeMonitorTimeout () |
Get's the timeout the scheduled task time monitor should use More... | |
virtual void | RefreshMarketHours (DateTime date) |
Refresh the market hours for each security in the given date More... | |
virtual void | RefreshSymbolProperties () |
Refresh the symbol properties for each security More... | |
virtual void | UpdateMarketHours (Security security) |
Updates the market hours for the specified security. More... | |
virtual void | UpdateSymbolProperties (Security security) |
Updates the symbol properties for the specified security. More... | |
virtual void | ResetMarketHoursDatabase () |
Resets the market hours database, forcing a reload when reused. Called in tests where multiple algorithms are run sequentially, and we need to guarantee that every test starts with the same environment. More... | |
Protected Member Functions inherited from QuantConnect.Lean.Engine.RealTime.BaseRealTimeHandler | |
int | GetScheduledEventUniqueId () |
Gets a new scheduled event unique id More... | |
Properties | |
MarketHoursDatabase | MarketHoursDatabase = MarketHoursDatabase.FromDataFolder() [get, set] |
Gets the current market hours database instance More... | |
SymbolPropertiesDatabase | SymbolPropertiesDatabase = SymbolPropertiesDatabase.FromDataFolder() [get, set] |
Gets the current symbol properties database instance More... | |
virtual ITimeProvider | TimeProvider = RealTimeProvider.Instance [get] |
Gets the time provider More... | |
override bool | IsActive [get, protected set] |
Boolean flag indicating thread state. More... | |
Properties inherited from QuantConnect.Lean.Engine.RealTime.BacktestingRealTimeHandler | |
override bool | IsActive [get, protected set] |
Flag indicating the hander thread is completely finished and ready to dispose. this doesn't run as its own thread More... | |
Properties inherited from QuantConnect.Lean.Engine.RealTime.BaseRealTimeHandler | |
abstract bool | IsActive [get, protected set] |
Thread status flag. More... | |
ConcurrentDictionary< ScheduledEvent, int > | ScheduledEvents = new() [get] |
The scheduled events container More... | |
IIsolatorLimitResultProvider | IsolatorLimitProvider [get] |
The isolator limit result provider instance More... | |
IAlgorithm | Algorithm [get] |
The algorithm instance More... | |
TimeMonitor | TimeMonitor [get] |
The time monitor instance to use More... | |
Properties inherited from QuantConnect.Lean.Engine.RealTime.IRealTimeHandler | |
bool | IsActive [get] |
Thread status flag. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from QuantConnect.Lean.Engine.RealTime.BacktestingRealTimeHandler | |
static void | SortFirstElement (IList< ScheduledEvent > scheduledEvents) |
Sorts the first element of the provided list and supposes the rest of the collection is sorted. Supposes the collection has at least 1 element More... | |
Live trading realtime event processing.
Definition at line 34 of file LiveTradingRealTimeHandler.cs.
|
virtual |
Initializes the real time handler for the specified algorithm and job
Reimplemented from QuantConnect.Lean.Engine.RealTime.BacktestingRealTimeHandler.
Definition at line 66 of file LiveTradingRealTimeHandler.cs.
|
protectedvirtual |
Get's the timeout the scheduled task time monitor should use
Reimplemented from QuantConnect.Lean.Engine.RealTime.BaseRealTimeHandler.
Definition at line 90 of file LiveTradingRealTimeHandler.cs.
|
protectedvirtual |
Refresh the market hours for each security in the given date
Each time this method is called, the MarketHoursDatabase is reset
Definition at line 136 of file LiveTradingRealTimeHandler.cs.
|
protectedvirtual |
Refresh the symbol properties for each security
Definition at line 165 of file LiveTradingRealTimeHandler.cs.
|
virtual |
Set the current time. If the date changes re-start the realtime event setup routines.
time |
Reimplemented from QuantConnect.Lean.Engine.RealTime.BacktestingRealTimeHandler.
Definition at line 189 of file LiveTradingRealTimeHandler.cs.
|
virtual |
Scan for past events that didn't fire because there was no data at the scheduled time.
time | Current time. |
Reimplemented from QuantConnect.Lean.Engine.RealTime.BacktestingRealTimeHandler.
Definition at line 208 of file LiveTradingRealTimeHandler.cs.
|
virtual |
Stop the real time thread
Reimplemented from QuantConnect.Lean.Engine.RealTime.BaseRealTimeHandler.
Definition at line 221 of file LiveTradingRealTimeHandler.cs.
|
protectedvirtual |
Updates the market hours for the specified security.
Definition at line 235 of file LiveTradingRealTimeHandler.cs.
|
protectedvirtual |
Updates the symbol properties for the specified security.
Definition at line 252 of file LiveTradingRealTimeHandler.cs.
|
protectedvirtual |
Resets the market hours database, forcing a reload when reused. Called in tests where multiple algorithms are run sequentially, and we need to guarantee that every test starts with the same environment.
Definition at line 264 of file LiveTradingRealTimeHandler.cs.
|
getsetprotected |
Gets the current market hours database instance
Definition at line 43 of file LiveTradingRealTimeHandler.cs.
|
getsetprotected |
Gets the current symbol properties database instance
Definition at line 48 of file LiveTradingRealTimeHandler.cs.
|
getprotected |
Gets the time provider
This should be fixed to RealTimeHandler, but made a protected property for testing purposes
Definition at line 56 of file LiveTradingRealTimeHandler.cs.
|
getprotected set |
Boolean flag indicating thread state.
Definition at line 61 of file LiveTradingRealTimeHandler.cs.