|
Lean
$LEAN_TAG$
|
Pseudo realtime event processing for backtesting to simulate realtime events in fast forward. 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 | Add (ScheduledEvent scheduledEvent) |
| Adds the specified event to the schedule More... | |
| override void | Remove (ScheduledEvent scheduledEvent) |
| Removes the specified event from the schedule More... | |
| override void | SetTime (DateTime time) |
| Set the time for the realtime event handler. More... | |
| override void | ScanPastEvents (DateTime time) |
| Scan for past events that didn't fire because there was no data at the scheduled time. 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... | |
| virtual void | Exit () |
| Stop the real time thread More... | |
Static Public Member Functions | |
| 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... | |
Properties | |
| 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 | |
Protected Member Functions inherited from QuantConnect.Lean.Engine.RealTime.BaseRealTimeHandler | |
| int | GetScheduledEventUniqueId () |
| Gets a new scheduled event unique id More... | |
| virtual int | GetTimeMonitorTimeout () |
| Get's the timeout the scheduled task time monitor should use More... | |
Pseudo realtime event processing for backtesting to simulate realtime events in fast forward.
Definition at line 32 of file BacktestingRealTimeHandler.cs.
|
virtual |
Initializes the real time handler for the specified algorithm and job
Reimplemented from QuantConnect.Lean.Engine.RealTime.BaseRealTimeHandler.
Reimplemented in QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler.
Definition at line 46 of file BacktestingRealTimeHandler.cs.
|
virtual |
Adds the specified event to the schedule
| scheduledEvent | The event to be scheduled, including the date/times the event fires and the callback |
Implements QuantConnect.Lean.Engine.RealTime.BaseRealTimeHandler.
Definition at line 67 of file BacktestingRealTimeHandler.cs.
|
virtual |
Removes the specified event from the schedule
| scheduledEvent | The event to be removed |
Implements QuantConnect.Lean.Engine.RealTime.BaseRealTimeHandler.
Definition at line 88 of file BacktestingRealTimeHandler.cs.
|
virtual |
Set the time for the realtime event handler.
| time | Current time. |
Implements QuantConnect.Lean.Engine.RealTime.BaseRealTimeHandler.
Reimplemented in QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler.
Definition at line 100 of file BacktestingRealTimeHandler.cs.
|
virtual |
Scan for past events that didn't fire because there was no data at the scheduled time.
| time | Current time. |
Implements QuantConnect.Lean.Engine.RealTime.BaseRealTimeHandler.
Reimplemented in QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler.
Definition at line 125 of file BacktestingRealTimeHandler.cs.
|
static |
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
Definition at line 172 of file BacktestingRealTimeHandler.cs.
|
getprotected set |
Flag indicating the hander thread is completely finished and ready to dispose. this doesn't run as its own thread
Definition at line 41 of file BacktestingRealTimeHandler.cs.