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  /// The algorithm settings instance to use
81  /// </summary>
83 
84  /// <summary>
85  /// Initializes a new instance of the <see cref="HistoryProviderInitializeParameters"/> class from the specified parameters
86  /// </summary>
87  /// <param name="job">The job</param>
88  /// <param name="api">The API instance</param>
89  /// <param name="dataProvider">Provider used to get data when it is not present on disk</param>
90  /// <param name="dataCacheProvider">Provider used to cache history data files</param>
91  /// <param name="mapFileProvider">Provider used to get a map file resolver to handle equity mapping</param>
92  /// <param name="factorFileProvider">Provider used to get factor files to handle equity price scaling</param>
93  /// <param name="statusUpdateAction">Function used to send status updates</param>
94  /// <param name="parallelHistoryRequestsEnabled">True if parallel history requests are enabled</param>
95  /// <param name="dataPermissionManager">The data permission manager to use</param>
96  /// <param name="objectStore">The object store to use</param>
97  /// <param name="algorithmSettings">The algorithm settings instance to use</param>
100  IApi api,
101  IDataProvider dataProvider,
102  IDataCacheProvider dataCacheProvider,
103  IMapFileProvider mapFileProvider,
104  IFactorFileProvider factorFileProvider,
105  Action<int> statusUpdateAction,
106  bool parallelHistoryRequestsEnabled,
107  IDataPermissionManager dataPermissionManager,
108  IObjectStore objectStore,
109  IAlgorithmSettings algorithmSettings)
110  {
111  Job = job;
112  Api = api;
113  DataProvider = dataProvider;
114  DataCacheProvider = dataCacheProvider;
115  MapFileProvider = mapFileProvider;
116  FactorFileProvider = factorFileProvider;
117  StatusUpdateAction = statusUpdateAction;
118  ParallelHistoryRequestsEnabled = parallelHistoryRequestsEnabled;
119  DataPermissionManager = dataPermissionManager;
120  ObjectStore = objectStore;
121  AlgorithmSettings = algorithmSettings;
122  }
123  }
124 }