Show OTM option quotes in option-option mode.
Align session to amplitude Call/Put pair and replace perp/ATM market panels. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -43,12 +43,20 @@ class OptionPair:
|
||||
strike: float
|
||||
call_inst_id: str
|
||||
put_inst_id: str
|
||||
put_strike: float | None = None # 期期:Put 行权价;None=与 strike 同(ATM)
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
put_k = (
|
||||
float(self.put_strike)
|
||||
if self.put_strike is not None
|
||||
else float(self.strike)
|
||||
)
|
||||
return {
|
||||
"expiry_ymd": self.expiry_ymd,
|
||||
"expiry_ms": self.expiry_ms,
|
||||
"strike": self.strike,
|
||||
"call_strike": float(self.strike),
|
||||
"put_strike": put_k,
|
||||
"call_inst_id": self.call_inst_id,
|
||||
"put_inst_id": self.put_inst_id,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user