From 8e34264e6dc171997c0f84c7f95db29c41e75596 Mon Sep 17 00:00:00 2001 From: John Colvin Date: Thu, 5 Sep 2024 16:44:28 -0400 Subject: [PATCH] fix: Filter by exch when getting atm data for sheets This is necessary now that we support exchanges with overlapping securities --- .../DataProviders/NMSheetSingleOptionMainDataSource.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/client/spark/NMSheets/DataProviders/NMSheetSingleOptionMainDataSource.cs b/src/client/spark/NMSheets/DataProviders/NMSheetSingleOptionMainDataSource.cs index 6b63c41f6..abec26ca7 100644 --- a/src/client/spark/NMSheets/DataProviders/NMSheetSingleOptionMainDataSource.cs +++ b/src/client/spark/NMSheets/DataProviders/NMSheetSingleOptionMainDataSource.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; @@ -236,8 +236,9 @@ namespace BCG { var option_exp_roll_data = vs_nvinp ?.get_roll_map(exp => exp.symbol == _nmsheet_symbol.option_name && + exp.exchange == _nmsheet_symbol.option_exchange && exp.security_type == SecurityType.Option) - ?.ToDictionary(kv => kv.Key.expiration, kv => kv.Value) + ?.ToDictionaryCrushed(kv => kv.Key.expiration, kv => kv.Value) ?? new(); IDictionary atm_data = OptionATMDataSource.compute_atm_data(_nmsheet_symbol.option_name, _get_onefive(), theo_data, option_exp_roll_data); if (sheet_settings.setting_atm.select_atm_nearest_strike_only)