Lean  $LEAN_TAG$
HistoryProviderInitializeParameters.cs
1 /*
2  * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
3  * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14 */
15 
16 using System;
18 using QuantConnect.Packets;
19 
20 namespace QuantConnect.Data
21 {
22  /// <summary>
23  /// Represents the set of parameters for the <see cref="IHistoryProvider.Initialize"/> method
24  /// </summary>
26  {
27  /// <summary>
28  /// The job
29  /// </summary>
30  public AlgorithmNodePacket Job { get; }
31 
32  /// <summary>
33  /// The API instance
34  /// </summary>
35  public IApi Api { get; }
36 
37  /// <summary>
38  /// The provider used to get data when it is not present on disk
39  /// </summary>
40  public IDataProvider DataProvider { get; }
41 
42  /// <summary>
43  /// The provider used to cache history data files
44  /// </summary>
46 
47  /// <summary>
48  /// The provider used to get a map file resolver to handle equity mapping
49  /// </summary>
51 
52  /// <summary>
53  /// The provider used to get factor files to handle equity price scaling
54  /// </summary>
56 
57  /// <summary>
58  /// A function used to send status updates
59  /// </summary>
60  public Action<int> StatusUpdateAction { get; }
61 
62  /// <summary>
63  /// True if parallel history requests are enabled
64  /// </summary>
65  /// <remarks>Parallel history requests are faster but require more ram and cpu usage
66  /// and are not compatible with some <see cref="IDataCacheProvider"/></remarks>
67  public bool ParallelHistoryRequestsEnabled { get; }
68 
69  /// <summary>
70  /// The data permission manager
71  /// </summary>
73 
74  /// <summary>
75  /// The object store
76  /// </summary>
77  public IObjectStore ObjectStore { get; }
78 
79  /// <summary>
80  /// Initializes a new instance of the <see cref="HistoryProviderInitializeParameters"/> class from the specified parameters
81  /// </summary>
82  /// <param name="job">The job</param>
83  /// <param name="api">The API instance</param>
84  /// <param name="dataProvider">Provider used to get data when it is not present on disk</param>
85  /// <param name="dataCacheProvider">Provider used to cache history data files</param>
86  /// <param name="mapFileProvider">Provider used to get a map file resolver to handle equity mapping</param>
87  /// <param name="factorFileProvider">Provider used to get factor files to handle equity price scaling</param>
88  /// <param name="statusUpdateAction">Function used to send status updates</param>
89  /// <param name="parallelHistoryRequestsEnabled">True if parallel history requests are enabled</param>
90  /// <param name="dataPermissionManager">The data permission manager to use</param>
91  /// <param name="objectStore">The object store to use</param>
94  IApi api,
95  IDataProvider dataProvider,
96  IDataCacheProvider dataCacheProvider,
97  IMapFileProvider mapFileProvider,
98  IFactorFileProvider factorFileProvider,
99  Action<int> statusUpdateAction,
100  bool parallelHistoryRequestsEnabled,
101  IDataPermissionManager dataPermissionManager,
102  IObjectStore objectStore)
103  {
104  Job = job;
105  Api = api;
106  DataProvider = dataProvider;
107  DataCacheProvider = dataCacheProvider;
108  MapFileProvider = mapFileProvider;
109  FactorFileProvider = factorFileProvider;
110  StatusUpdateAction = statusUpdateAction;
111  ParallelHistoryRequestsEnabled = parallelHistoryRequestsEnabled;
112  DataPermissionManager = dataPermissionManager;
113  ObjectStore = objectStore;
114  }
115  }
116 }