From f1df673e61648bf3a57eae126beab54f76ac7445 Mon Sep 17 00:00:00 2001 From: Taha Afzal Date: Mon, 23 Dec 2019 18:43:14 -0500 Subject: [PATCH] spread parsing gix, Z29 showed up --- .vscode/launch.json | 6 ++++++ .../StaticAnalysis/MarketQueriesHelper.cs | 18 ++++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 496d44950..46fafb025 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -165,6 +165,12 @@ "externalConsole": true, "requireExactSource": false }, + { + "name": "Client Attach", + "type": "clr", + "request": "attach", + "processId": "${command:pickProcess}" + }, { "name": ".NET Framework Attach", "type": "clr", diff --git a/src/client/spark_historical/StaticAnalysis/MarketQueriesHelper.cs b/src/client/spark_historical/StaticAnalysis/MarketQueriesHelper.cs index cfed9f80b..8ea31b90a 100644 --- a/src/client/spark_historical/StaticAnalysis/MarketQueriesHelper.cs +++ b/src/client/spark_historical/StaticAnalysis/MarketQueriesHelper.cs @@ -200,11 +200,16 @@ namespace bts.history{ var exp_map = new SortedDictionary(); // parse out exp Func get_exp = (t) => { - Log.assert(t.Count()==4); - int month = mmap[t.ElementAt(2).ToString()]; - int yr = Int32.Parse(t.ElementAt(3).ToString()); - yr = (yr == 9 ? -1 : yr) + 2020; - return new DateTime(yr,month,1); + if(t.Count()==4){ + int month = mmap[t.ElementAt(2).ToString()]; + int yr = Int32.Parse(t.ElementAt(3).ToString()); + yr = (yr == 9 ? -1 : yr) + 2020; + return new DateTime(yr,month,1); + } + else{ + Console.WriteLine("Could not parse {0}",t); + return DateTime.MinValue; + } }; foreach (var s in smap) if(!s.Contains(".")){ @@ -215,7 +220,8 @@ namespace bts.history{ string sym = t.Substring(0,2); if(sym == symbol){ var e = get_exp(t); - exp_map[e] = t; + if(e != DateTime.MinValue) + exp_map[e] = t; } } }