Skip to content

Commit

Permalink
Revert "Disable traded securities configs storage for live trading (#…
Browse files Browse the repository at this point in the history
…7574)" (#7577)

This reverts commit 9029c70.
  • Loading branch information
Martin-Molinero authored Nov 16, 2023
1 parent de10a1d commit 428d620
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions Engine/LeanEngineAlgorithmHandlers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ namespace QuantConnect.Lean.Engine
/// </summary>
public class LeanEngineAlgorithmHandlers : IDisposable
{
private bool _dataMonitorEventsSet;

/// <summary>
/// Gets the result handler used to communicate results from the algorithm
/// </summary>
Expand Down Expand Up @@ -181,12 +179,11 @@ public LeanEngineAlgorithmHandlers(IResultHandler results,
DataCacheProvider = new ZipDataCacheProvider(DataProvider, isDataEphemeral: liveMode);

DataMonitor = new DataMonitor();
Transactions.NewOrderEvent += DataMonitor.OnOrderEvent;

if (!liveMode && !researchMode)
{
DataProvider.NewDataRequest += DataMonitor.OnNewDataRequest;
Transactions.NewOrderEvent += DataMonitor.OnOrderEvent;
_dataMonitorEventsSet = true;
}
}

Expand Down Expand Up @@ -253,11 +250,7 @@ public void Dispose()
Setup.DisposeSafely();
ObjectStore.DisposeSafely();

if (_dataMonitorEventsSet)
{
DataProvider.NewDataRequest -= DataMonitor.OnNewDataRequest;
Transactions.NewOrderEvent -= DataMonitor.OnOrderEvent;
}
Transactions.NewOrderEvent -= DataMonitor.OnOrderEvent;
DataMonitor.DisposeSafely();

Log.Trace("LeanEngineAlgorithmHandlers.Dispose(): Disposed of algorithm handlers.");
Expand Down

0 comments on commit 428d620

Please sign in to comment.