Show OKX option Delta on hedge plan strike picker.
Surface ticker delta (gamma in tooltip) in the chain table and selected premium line for easier ITM selection. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -285,6 +285,9 @@ def _resolve_chain_quote(
|
||||
if ask_estimated:
|
||||
ask_sz = None
|
||||
|
||||
# OKX 期权 ticker 自带希腊字母(选约用);缺省时前端显示 —
|
||||
delta = _safe_float(ticker.get("delta") or ticker.get("deltaBS"))
|
||||
gamma = _safe_float(ticker.get("gamma") or ticker.get("gammaBS"))
|
||||
return {
|
||||
"ask": ask,
|
||||
"bid": bid,
|
||||
@@ -292,6 +295,8 @@ def _resolve_chain_quote(
|
||||
"bid_sz": bid_sz,
|
||||
"mark_px": mark,
|
||||
"ask_estimated": ask_estimated,
|
||||
"delta": delta,
|
||||
"gamma": gamma,
|
||||
}
|
||||
|
||||
|
||||
@@ -945,6 +950,8 @@ def build_option_chain(
|
||||
"bid_sz": bid_sz,
|
||||
"mark_px": mark,
|
||||
"ask_estimated": q["ask_estimated"],
|
||||
"delta": q.get("delta"),
|
||||
"gamma": q.get("gamma"),
|
||||
"expiry_be_px": expiry_be,
|
||||
"dist_expiry_be": strike_distance_to_be(strike, expiry_be, opt_type=opt_type),
|
||||
"moneyness": mny,
|
||||
|
||||
Reference in New Issue
Block a user