chain = slice.OptionChains.get(self.symbol)

这句代码应该返回一个OptionChain对象,Cloud IDE在调试过程中,VARIABLES Panel中在chain.Contracts.Values中不会看见OptionContract的任何属性。

OptionContract应该包含如下属性:

Symbol: Symbol

UnderlyingSymbol: Symbol

Strike: decimal

Expiry: DateTime

Right: OptionRight

Style: OptionStyle

TheoreticalPrice: decimal

ImpliedVolatility: decimal

Greeks: Greeks

Time: DateTime

OpenInterest: decimal

LastPrice: decimal

Volume: int

BidPrice: decimal

BidSize: int

AskPrice: decimal

AskSize: int

UnderlyingLastPrice: decimal

Author

HONGYUZHANG

July 2023