diff --git a/Engine/Setup/BrokerageSetupHandler.cs b/Engine/Setup/BrokerageSetupHandler.cs index 6c85fee785cf..b06fd71c36ce 100644 --- a/Engine/Setup/BrokerageSetupHandler.cs +++ b/Engine/Setup/BrokerageSetupHandler.cs @@ -418,7 +418,7 @@ protected bool LoadExistingHoldingsAndOrders(IBrokerage brokerage, IAlgorithm al // verify existing holding security type Security security; - if (!algorithm.Securities.TryGetValue(holding.Symbol, out security) && !AddUnrequestedSecurity(algorithm, holding.Symbol, holding.Type, out security)) + if (!GetOrAddUnrequestedSecurity(algorithm, holding.Symbol, holding.Type, out security)) { continue; } @@ -459,7 +459,7 @@ protected bool LoadExistingHoldingsAndOrders(IBrokerage brokerage, IAlgorithm al return true; } - private bool AddUnrequestedSecurity(IAlgorithm algorithm, Symbol symbol, SecurityType securityType, out Security security) + private bool GetOrAddUnrequestedSecurity(IAlgorithm algorithm, Symbol symbol, SecurityType securityType, out Security security) { if (!algorithm.Securities.TryGetValue(symbol, out security)) { @@ -523,7 +523,7 @@ protected void GetOpenOrders(IAlgorithm algorithm, IResultHandler resultHandler, { // verify existing holding security type Security security; - if (!algorithm.Securities.TryGetValue(order.Symbol, out security) && !AddUnrequestedSecurity(algorithm, order.Symbol, order.SecurityType, out security)) + if (!GetOrAddUnrequestedSecurity(algorithm, order.Symbol, order.SecurityType, out security)) { continue; }