Merged in SPARK-2476-OB-KeyNotFoundException (pull request #248)
RTM: SPARK-2476 OB _get_legs KeyNotFoundException Approved-by: Jake Norbut <jake.norbut@bluetradesys.com>
This commit is contained in:
commit
84d666c29c
1 file changed
+3
-6
@@ -322,12 +322,9 @@ namespace mbts.spark {
|
||||
}
|
||||
|
||||
static IEnumerable<LegSpreaderParamsTuple> _get_legs(Security synthetic, ExecutionStrategyImmutable strategy) {
|
||||
try {
|
||||
var results = synthetic.Synthetic.Legs
|
||||
.Select(l => new LegSpreaderParamsTuple(l, strategy.LegParamsMap[l.Security.Id].Clone())).ToList();
|
||||
return results;
|
||||
} catch (KeyNotFoundException) {
|
||||
return Enumerable.Empty<LegSpreaderParamsTuple>();
|
||||
foreach (var l in synthetic.Synthetic.Legs) {
|
||||
if (strategy.LegParamsMap.TryGetValue(l.Security.Id, out var p))
|
||||
yield return new LegSpreaderParamsTuple(l, p);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user