diff --git a/.vscode/launch.json b/.vscode/launch.json index 2dc42f361..cde313839 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -2,9 +2,10 @@ "version": "0.2.0", "configurations": [ { - "name": ".NET Core Attach", + "name": "Attach Spark", "type": "coreclr", - "request": "attach" + "request": "attach", + "processId": "${command:pickProcess}" }, { "name": "DataStreamPublisher", @@ -326,4 +327,4 @@ "description": "Test to run", }, ] -} +} \ No newline at end of file diff --git a/src/client/spark/AW2/Bus/VolSurfaceBlackboardManager.cs b/src/client/spark/AW2/Bus/VolSurfaceBlackboardManager.cs index b511be2da..47a9cedce 100644 --- a/src/client/spark/AW2/Bus/VolSurfaceBlackboardManager.cs +++ b/src/client/spark/AW2/Bus/VolSurfaceBlackboardManager.cs @@ -130,6 +130,12 @@ namespace mbts.spark var vs_sub = _analytics_service.subscribei_volsurfaces() .ObserveOn(SynchronizationContext.Current) .Subscribe(_on_vss); + var hist_theos_sub_obs = _analytics_service.subscribei_archived_theos_table(); + var obs = hist_theos_sub_obs.ObserveOn(SynchronizationContext.Current);//.Subcribe(_on_hist_theos); + obs.Subscribe(tu => { + Log.Gen.info("Received historical theos"); + _on_hist_theos(tu); + }); var vs_usage_sub = _analytics_service.subscribei_volsurface_usage() .ObserveOn(SynchronizationContext.Current) .Subscribe(_on_vs_usage_update); @@ -295,6 +301,8 @@ namespace mbts.spark void _on_vs_usage_update(Update update) { + var state = update.all; + Log.Gen.info($"VSBBMan._on_vs_usage_update size: {state.Count()}"); // TODO return; } @@ -313,6 +321,11 @@ namespace mbts.spark _init_vss(to_publish.Keys); } + void _on_hist_theos(bts.api.core.TableUpdate update) { + var total_state = update.state; + Log.assert(false); + } + private void _init_vss(IEnumerable vs_ids) { // we consider every vs in the db as "activated" which might prove to be expensive @@ -365,7 +378,9 @@ namespace mbts.spark _bb.post(SparkTags.VolSurfaceNonVolInputTag, new mbts.analytics.VolSurfaceNonVolInput(exp_param_map.exp_map.ToDictionary())); } + // this is publishe dby the sheets else if (_archive_ivs_tag.Equals(tag)){ + //Log.assert(false); NMSheetSymbol sym = data as NMSheetSymbol; SystemContractData sc_data = _bb.read_state(SparkTags.SystemContractsTag); var associated_syms = _get_associated_symbols(sym); @@ -379,7 +394,7 @@ namespace mbts.spark double strike = t.second; TheoPoint tp = t.third; Tuple cp_id = sc_data.get_option_sec_id(v, symbol, exp, strike); - if (cp_id.Item2.HasValue && cp_id.Item2.HasValue){ + if (cp_id != null && cp_id.Item1.HasValue && cp_id.Item2.HasValue){ // call ArchivedSecurityTheo c_theo = new ArchivedSecurityTheo(); c_theo.Id = cp_id.Item1.Value; @@ -401,6 +416,7 @@ namespace mbts.spark } ArchivedTheoList rv_list = new ArchivedTheoList(); rv_list.SecTheo.AddRange(theo_list); + bts.Log.Gen.info($"VSBBMan archiving {rv_list.SecTheo.Count} entries"); _analytics_service.clean_and_archive_theos(rv_list); // send it to the server } @@ -430,7 +446,7 @@ namespace mbts.spark } private List _get_associated_symbols(NMSheetSymbol symbol){ - return new List() {new NMSheetSymbol(Venue.Cboe, "spx"),new NMSheetSymbol(Venue.Cboe, "spxw")}; + return new List() {new NMSheetSymbol(Venue.Cboe, "SPX"),new NMSheetSymbol(Venue.Cboe, "SPXW")}; } private int _timer_count = 0; diff --git a/src/client/spark/AW2/LiveTheoPublisher.cs b/src/client/spark/AW2/LiveTheoPublisher.cs index ac8bca670..bdd22d966 100644 --- a/src/client/spark/AW2/LiveTheoPublisher.cs +++ b/src/client/spark/AW2/LiveTheoPublisher.cs @@ -158,7 +158,7 @@ namespace mbts.spark { private bool _compute_midmarket { get { - return true; + return false; } } diff --git a/src/client/spark/AW2/Misc/SystemContractData.cs b/src/client/spark/AW2/Misc/SystemContractData.cs index b4fdb1a9e..1d7b3e232 100644 --- a/src/client/spark/AW2/Misc/SystemContractData.cs +++ b/src/client/spark/AW2/Misc/SystemContractData.cs @@ -50,7 +50,7 @@ namespace mbts.spark { callId = s.Id; break; case PutOrCall.Put: - Log.assert(!putId.HasValue); + //Log.assert(!putId.HasValue); putId = s.Id; break; default: