From 5992f4814d60c9f970c8204a6ce4e8aca9edff68 Mon Sep 17 00:00:00 2001 From: Kevin Darby Date: Wed, 4 Sep 2019 17:02:06 -0400 Subject: [PATCH] testing replay --- .vscode/launch.json | 7 +++++-- .../sparkcmd/Cmd/Historical/HistoricalDataReplayer.cs | 6 +++--- src/client/sparkcmd/Cmd/HistoricalDataCommand.cs | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 0a8529d91..cc14fafdb 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -105,8 +105,11 @@ "program": "${workspaceRoot}/build/Debug/bin/net471/sparkcmd.exe", "args": [ "historical", - "-d", - "mbo/mbo/20190429/20190429-MBO_xcbt_zn_fut_0-eth.gz", + "--rstart", "09/02/2019", + "--rend", "09/03/2019", + "--rsymbol", "ZN", + "--rsecuritytype", "Future", + "--micros", "20", ], "cwd": "${workspaceRoot}", "stopAtEntry": false, diff --git a/src/client/sparkcmd/Cmd/Historical/HistoricalDataReplayer.cs b/src/client/sparkcmd/Cmd/Historical/HistoricalDataReplayer.cs index 7651a2522..25533260f 100644 --- a/src/client/sparkcmd/Cmd/Historical/HistoricalDataReplayer.cs +++ b/src/client/sparkcmd/Cmd/Historical/HistoricalDataReplayer.cs @@ -39,7 +39,7 @@ namespace bts.history { var chanup = new co2.ChannelUpdate() { - Key = md.SecurityId, + Key = md.SecurityId, //TODO join with the secdefs that I don't have Security = new Security() { Id = md.SecurityId, @@ -130,8 +130,8 @@ namespace bts.history Exchange = Venue.Glbx, Symbol = symbol, SecurityType = st, - Begin = Timestamp.FromDateTime(start), - End = Timestamp.FromDateTime(end) + Begin = Timestamp.FromDateTime(DateTime.SpecifyKind(start, DateTimeKind.Utc)), + End = Timestamp.FromDateTime(DateTime.SpecifyKind(end, DateTimeKind.Utc)) }; var str = await _server.get_md_stream(query); api.Product prod = new Product() { Exchange = query.Exchange, Type = query.SecurityType, Symbol = query.Symbol }; diff --git a/src/client/sparkcmd/Cmd/HistoricalDataCommand.cs b/src/client/sparkcmd/Cmd/HistoricalDataCommand.cs index 7fb748e0f..803bc0ded 100644 --- a/src/client/sparkcmd/Cmd/HistoricalDataCommand.cs +++ b/src/client/sparkcmd/Cmd/HistoricalDataCommand.cs @@ -38,7 +38,7 @@ namespace bts.history [Option('t', "rsecuritytype", Required = false, HelpText = "SecurityType for 'replay' from cme mbo files into our system as orders")] public string replaysecurity{ get; set; } - [Option('d', "micros", Required = false, HelpText = "A quantum of time, in microseconds")] + [Option('m', "micros", Required = false, HelpText = "A quantum of time, in microseconds")] public int dt_us{ get; set; } }