Пример #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UniverseSelection"/> class
 /// </summary>
 /// <param name="algorithm">The algorithm to add securities to</param>
 /// <param name="securityService">The security service</param>
 /// <param name="dataPermissionManager">The data permissions manager</param>
 /// <param name="dataProvider">The data provider to use</param>
 /// <param name="internalConfigResolution">The resolution to use for internal configuration</param>
 public UniverseSelection(
     IAlgorithm algorithm,
     ISecurityService securityService,
     IDataPermissionManager dataPermissionManager,
     IDataProvider dataProvider,
     Resolution internalConfigResolution = Resolution.Minute)
 {
     _dataProvider           = dataProvider;
     _algorithm              = algorithm;
     _securityService        = securityService;
     _dataPermissionManager  = dataPermissionManager;
     _pendingRemovalsManager = new PendingRemovalsManager(algorithm.Transactions);
     _currencySubscriptionDataConfigManager = new CurrencySubscriptionDataConfigManager(algorithm.Portfolio.CashBook,
                                                                                        algorithm.Securities,
                                                                                        algorithm.SubscriptionManager,
                                                                                        _securityService,
                                                                                        dataPermissionManager.GetResolution(Resolution.Minute));
     // TODO: next step is to merge currency internal subscriptions under the same 'internal manager' instance and we could move this directly into the DataManager class
     _internalSubscriptionManager = new InternalSubscriptionManager(_algorithm, internalConfigResolution);
 }