Select 使用 lambda 的合约的最大行使价
Select max strike from contracts using lambda
我正在尝试查找新旧合同的匹配,如果找到匹配 select 最高行使价,但我不需要给我一个小数,而是需要给我一个条目。我怎样才能正确地做到这一点?
Dim Contract as Entry = iContracts.Values.Where(Function(a) a.UnderlyingSymbol = iNew_Contract.UnderlyingSymbol).Max(Function(x) x.StrikePrice)
Value of type 'Decimal' cannot be converted to Entry
使用 Where 筛选,然后按行使价排序:
Dim Contract as Entry = iContracts.Values
.Where(Function(a) a.UnderlyingSymbol = New_Contract.UnderlyingSymbol)
.OrderByDescending(Function(a) a.StrikePrice).FirstOrDefault
我正在尝试查找新旧合同的匹配,如果找到匹配 select 最高行使价,但我不需要给我一个小数,而是需要给我一个条目。我怎样才能正确地做到这一点?
Dim Contract as Entry = iContracts.Values.Where(Function(a) a.UnderlyingSymbol = iNew_Contract.UnderlyingSymbol).Max(Function(x) x.StrikePrice)
Value of type 'Decimal' cannot be converted to Entry
使用 Where 筛选,然后按行使价排序:
Dim Contract as Entry = iContracts.Values
.Where(Function(a) a.UnderlyingSymbol = New_Contract.UnderlyingSymbol)
.OrderByDescending(Function(a) a.StrikePrice).FirstOrDefault