18 using System.ComponentModel.Composition;
125 bool researchMode =
false
130 throw new ArgumentNullException(nameof(results));
134 throw new ArgumentNullException(nameof(setup));
136 if (dataFeed ==
null)
138 throw new ArgumentNullException(nameof(dataFeed));
140 if (transactions ==
null)
142 throw new ArgumentNullException(nameof(transactions));
144 if (realTime ==
null)
146 throw new ArgumentNullException(nameof(realTime));
148 if (mapFileProvider ==
null)
150 throw new ArgumentNullException(nameof(mapFileProvider));
152 if (factorFileProvider ==
null)
154 throw new ArgumentNullException(nameof(factorFileProvider));
156 if (dataProvider ==
null)
158 throw new ArgumentNullException(nameof(dataProvider));
160 if (objectStore ==
null)
162 throw new ArgumentNullException(nameof(objectStore));
164 if (dataPermissionsManager ==
null)
166 throw new ArgumentNullException(nameof(dataPermissionsManager));
182 if (!liveMode && !researchMode)
197 var setupHandlerTypeName =
Config.
Get(
"setup-handler",
"ConsoleSetupHandler");
198 var transactionHandlerTypeName =
Config.
Get(
"transaction-handler",
"BacktestingTransactionHandler");
199 var realTimeHandlerTypeName =
Config.
Get(
"real-time-handler",
"BacktestingRealTimeHandler");
200 var dataFeedHandlerTypeName =
Config.
Get(
"data-feed-handler",
"FileSystemDataFeed");
201 var resultHandlerTypeName =
Config.
Get(
"result-handler",
"BacktestingResultHandler");
202 var mapFileProviderTypeName =
Config.
Get(
"map-file-provider",
"LocalDiskMapFileProvider");
203 var factorFileProviderTypeName =
Config.
Get(
"factor-file-provider",
"LocalDiskFactorFileProvider");
204 var dataProviderTypeName =
Config.
Get(
"data-provider",
"DefaultDataProvider");
205 var objectStoreTypeName =
Config.
Get(
"object-store",
"LocalObjectStore");
206 var dataPermissionManager =
Config.
Get(
"data-permission-manager",
"DataPermissionManager");
209 composer.GetExportedValueByTypeName<
IResultHandler>(resultHandlerTypeName),
210 composer.GetExportedValueByTypeName<
ISetupHandler>(setupHandlerTypeName),
211 composer.GetExportedValueByTypeName<
IDataFeed>(dataFeedHandlerTypeName),
213 composer.GetExportedValueByTypeName<
IRealTimeHandler>(realTimeHandlerTypeName),
214 composer.GetExportedValueByTypeName<
IMapFileProvider>(mapFileProviderTypeName),
216 composer.GetExportedValueByTypeName<
IDataProvider>(dataProviderTypeName),
217 composer.GetExportedValueByTypeName<
IObjectStore>(objectStoreTypeName),
223 result.FactorFileProvider.Initialize(result.MapFileProvider, result.DataProvider);
224 result.MapFileProvider.Initialize(result.DataProvider);
229 throw new ArgumentException($
"The {typeof(ApiDataProvider)} can only be used with {typeof(LocalZipFactorFileProvider)}" +
230 $
" and {typeof(LocalZipMapFileProvider)}, please update 'config.json'");
244 Log.
Trace(
"LeanEngineAlgorithmHandlers.Dispose(): start...");
247 Setup.DisposeSafely();
251 Log.
Trace(
"LeanEngineAlgorithmHandlers.Dispose(): Disposed of algorithm handlers.");