generated from QuantConnect/Lean.DataSource.SDK
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathProgram.cs
More file actions
44 lines (35 loc) · 1.78 KB
/
Program.cs
File metadata and controls
44 lines (35 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using QuantConnect.Logging;
using System.Globalization;
using QuantConnect.Configuration;
namespace QuantConnect.DataProcessing
{
internal class Program
{
public static string DataFleetDeploymentDate = "QC_DATAFLEET_DEPLOYMENT_DATE";
private static void Main(string[] args)
{
var rawDataFolder = new DirectoryInfo(Config.Get("raw-data-folder", "/raw"));
var temporaryOutputDirectory = Config.Get("temp-output-directory", "/temp-output-directory");
// Allow for caller to specify which market they want to process
var market = args.Length != 0 && !string.IsNullOrWhiteSpace(args[0])
? args[0]
: null;
var securityType = SecurityType.Crypto;
if (args.Length > 1 && !string.IsNullOrWhiteSpace(args[1]))
{
securityType = (SecurityType)Enum.Parse(typeof(SecurityType), args[1], true);
}
Environment.SetEnvironmentVariable(DataFleetDeploymentDate, "20240211");
var processingDateValue = Environment.GetEnvironmentVariable(DataFleetDeploymentDate);
var processingDate = DateTime.ParseExact(processingDateValue, "yyyyMMdd", CultureInfo.InvariantCulture);
Log.Trace($"Price.Crypto.CoinApi.Main(): Processing {processingDate} for market: {market ?? "*"} SecurityType: {securityType}");
var converter = new CoinApiDataConverter(processingDate, rawDataFolder.FullName, temporaryOutputDirectory, market, securityType);
if (!converter.Run())
{
Log.Error($"Price.Crypto.CoinApi.Main(): Processing CoinAPI for date {processingDate:yyyy-MM-dd} failed");
Environment.Exit(1);
}
Environment.Exit(0);
}
}
}