fix: Filter by exch when getting atm data for sheets

This is necessary now that we support exchanges with overlapping securities
This commit is contained in:
John Colvin committed 2024-09-13 10:50:21 -04:00
1 parent 0a840d256b
commit 8e34264e6d
1 file changed
+3 -2
@@ -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<DateTime, ATMData> 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)