diff --git a/src/client/spark/AW2/Bus/SingleVolSurfaceGateway.cs b/src/client/spark/AW2/Bus/SingleVolSurfaceGateway.cs index 59b0b46b2..314daf9af 100644 --- a/src/client/spark/AW2/Bus/SingleVolSurfaceGateway.cs +++ b/src/client/spark/AW2/Bus/SingleVolSurfaceGateway.cs @@ -130,6 +130,8 @@ namespace mbts.spark { SystemContractData sc_data = _bb.read_state(SparkTags.SystemContractsTag); var rv = SingleVolSurfaceTheoSource.convert_to_id_map(cand_theos, sc_data); rv.SaveTime = VolSurfaceUtilityFunctions.get_unix_epoch_msecs(); + var sec_tups = SingleVolSurfaceTheoSource.get_vs_sectups(_volsurface_id, _bb); + rv.SecTups.AddRange(sec_tups); // TODO, figure out from vs usage which sec_tups to populate return rv; } diff --git a/src/client/spark/AW2/Bus/SingleVolSurfaceTheoSource.cs b/src/client/spark/AW2/Bus/SingleVolSurfaceTheoSource.cs index 14cfacc58..d2ee95cfc 100644 --- a/src/client/spark/AW2/Bus/SingleVolSurfaceTheoSource.cs +++ b/src/client/spark/AW2/Bus/SingleVolSurfaceTheoSource.cs @@ -158,6 +158,13 @@ namespace mbts.spark { return new Dictionary>(); } + public static IEnumerable get_vs_sectups( + int vs_id, ThreadedBlackboard bb) { + VolSurfaceUsageListImmutable vs_usage_list = bb.read_state(SparkTags.VolSurfaceUsageTag); + return vs_usage_list.get_sectups(vs_id); + } + + // old -> new transformation, this is slow ! transforms data from one // form to another public static ArchivedTheoList diff --git a/src/client/spark/AW2/VolSurfaceExtensions.cs b/src/client/spark/AW2/VolSurfaceExtensions.cs index 02d462ca9..900d3344f 100644 --- a/src/client/spark/AW2/VolSurfaceExtensions.cs +++ b/src/client/spark/AW2/VolSurfaceExtensions.cs @@ -27,6 +27,21 @@ public static bool symbol_driven_by_vs(this VolSurfaceUsageListImmutable list, string option_name, int vs_id) => list.UsageList.Any(u => u.SymbolName == option_name && u.VsId == vs_id); + public static IEnumerable get_sectups( + this VolSurfaceUsageListImmutable list, int vs_id) { + List rv = new List(); + if (list.UsageList != null) + foreach (var u in list.UsageList) { + if (u.VsId == vs_id) { + bts.api.SecurityTuple st = new SecurityTuple(); + st.Type = SecurityType.Option; + st.Venue = u.SymbolVenue; + st.Symbol = u.SymbolName; + } + } + return rv; + } + public static HashSet hidden_cols(this VolSurfaceMacroGridSettings gs) => new(gs.column_settings.Where(cc => !cc.is_visible).Select(cc => cc.id)); diff --git a/src/client/spark/Analytics/Core/VolSurfaceConstants.cs b/src/client/spark/Analytics/Core/VolSurfaceConstants.cs index 2b80c0cc3..fa9e2e577 100644 --- a/src/client/spark/Analytics/Core/VolSurfaceConstants.cs +++ b/src/client/spark/Analytics/Core/VolSurfaceConstants.cs @@ -1,4 +1,6 @@ -using System; +using bts.api; + +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -8,4 +10,10 @@ namespace mbts.analytics { public static class VolSurfaceConstants { public static int vol_time_sample_mins = 1; } + // TODO: remove this + public static class VolSurfaceTemp { + public static Venue get_default_venue(SecurityType sec_type, string symbol_name) { + return Venue.Sim; + } + } }