diff --git a/QuantConnect.InteractiveBrokersBrokerage/InteractiveBrokersBrokerage.cs b/QuantConnect.InteractiveBrokersBrokerage/InteractiveBrokersBrokerage.cs index 219192c..09ab9a1 100644 --- a/QuantConnect.InteractiveBrokersBrokerage/InteractiveBrokersBrokerage.cs +++ b/QuantConnect.InteractiveBrokersBrokerage/InteractiveBrokersBrokerage.cs @@ -1225,6 +1225,9 @@ private void Initialize( { return; } + + ValidateSubscription(); + _isInitialized = true; _loadExistingHoldings = loadExistingHoldings; _algorithm = algorithm; @@ -1304,8 +1307,6 @@ private void Initialize( _connectEvent.Set(); }; - ValidateSubscription(); - // initialize our heart beat thread RunHeartBeatThread(); @@ -4879,9 +4880,9 @@ private static void ValidateSubscription() try { var productId = 181; - var userId = Config.GetInt("job-user-id"); - var token = Config.Get("api-access-token"); - var organizationId = Config.Get("job-organization-id", null); + var userId = Globals.UserId; + var token = Globals.UserToken; + var organizationId = Globals.OrganizationID; // Verify we can authenticate with this user and token var api = new ApiConnection(userId, token); if (!api.Connected)