fix(hedge): filter options-chain by min hours and strike interval for option-primary
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1036,9 +1036,16 @@
|
||||
}
|
||||
|
||||
async function loadChain() {
|
||||
const d = await apiJson(
|
||||
"/api/hedge-plan/options-chain?underlying=" + encodeURIComponent(state.underlying)
|
||||
);
|
||||
let url =
|
||||
"/api/hedge-plan/options-chain?underlying=" + encodeURIComponent(state.underlying);
|
||||
if (isOptionPrimary()) {
|
||||
url +=
|
||||
"&option_primary=1&min_hours=" +
|
||||
encodeURIComponent(String(numInput("hp-min-hours", 36))) +
|
||||
"&strike_interval=" +
|
||||
encodeURIComponent(String(numInput("hp-strike-interval", 15)));
|
||||
}
|
||||
const d = await apiJson(url);
|
||||
state.chain = d;
|
||||
const idx = $("hp-index-line");
|
||||
if (idx) idx.textContent = "指数 " + fmt(d.index_px, 2);
|
||||
|
||||
Reference in New Issue
Block a user