Add OKX options review module with hedge plan entries.

Import closed OKX option history and closed hedge plans into one list for journaling, images, and stats without mixing contract reviews.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-17 09:35:19 +08:00
parent eb5c6a658b
commit 10128d18bc
17 changed files with 2133 additions and 3 deletions
@@ -15,6 +15,7 @@ DEFAULT_INSTANCE_DISPLAY: dict[str, bool] = {
"show_nav_risk_policy": True,
"show_nav_env_config": True,
"show_nav_options": True,
"show_nav_options_review": True,
"show_nav_hedge_plan": True,
"show_settings_transfer": True,
"show_settings_export": True,
@@ -31,6 +32,7 @@ DISPLAY_LABELS: dict[str, str] = {
"show_nav_risk_policy": "风控说明",
"show_nav_env_config": "env配置",
"show_nav_options": "期权",
"show_nav_options_review": "期权复盘",
"show_nav_hedge_plan": "对冲计划",
"show_settings_transfer": "资金划转",
"show_settings_export": "数据导出",
@@ -47,6 +49,7 @@ NAV_TAB_ALLOWED: dict[str, str] = {
"risk_policy": "show_nav_risk_policy",
"env_config": "show_nav_env_config",
"options": "show_nav_options",
"options_review": "show_nav_options_review",
"hedge_plan": "show_nav_hedge_plan",
}
@@ -107,6 +110,7 @@ def display_meta_for_ui() -> list[dict[str, Any]]:
"show_nav_risk_policy",
"show_nav_env_config",
"show_nav_options",
"show_nav_options_review",
"show_nav_hedge_plan",
]
settings_keys = [
+2
View File
@@ -16,6 +16,7 @@ EMBED_TABS: tuple[str, ...] = (
"strategy",
"strategy_records",
"options",
"options_review",
"hedge_plan",
"records",
"stats",
@@ -33,6 +34,7 @@ PATH_TO_EMBED_TAB: dict[str, str] = {
"/strategy/roll": "strategy",
"/strategy/records": "strategy_records",
"/options": "options",
"/options/review": "options_review",
"/hedge-plan": "hedge_plan",
"/records": "records",
"/stats": "stats",
@@ -293,6 +293,8 @@
{% include 'strategy_records_page.html' %}
{% elif page == 'options' %}
{% include 'options_panel.html' %}
{% elif page == 'options_review' %}
{% include 'options_review_panel.html' %}
{% elif page == 'hedge_plan' %}
{% include 'hedge_plan_panel.html' %}
{% endif %}
+3
View File
@@ -46,6 +46,9 @@
{% if options_nav_visible and display.show_nav_options %}
<a href="/options" data-embed-tab="options" class="{% if initial_tab == 'options' %}active{% endif %}">期权</a>
{% endif %}
{% if options_nav_visible and display.show_nav_options_review %}
<a href="/options/review" data-embed-tab="options_review" class="{% if initial_tab == 'options_review' %}active{% endif %}">期权复盘</a>
{% endif %}
{% if hedge_plan_nav_visible and display.show_nav_hedge_plan %}
<a href="/hedge-plan" data-embed-tab="hedge_plan" class="{% if initial_tab == 'hedge_plan' %}active{% endif %}">对冲计划</a>
{% endif %}
+6 -1
View File
@@ -133,6 +133,9 @@
{% if options_nav_visible and display.show_nav_options %}
<a href="/options" class="{% if page == 'options' %}active{% endif %}">期权</a>
{% endif %}
{% if options_nav_visible and display.show_nav_options_review %}
<a href="/options/review" class="{% if page == 'options_review' %}active{% endif %}">期权复盘</a>
{% endif %}
{% if hedge_plan_nav_visible and display.show_nav_hedge_plan %}
<a href="/hedge-plan" class="{% if page == 'hedge_plan' %}active{% endif %}">对冲计划</a>
{% endif %}
@@ -147,7 +150,7 @@
{% with msg=get_flashed_messages() %}{% if msg %}<div class="flash">{{ msg[0] }}</div>{% endif %}{% endwith %}
{% include 'instance_header_panel.html' %}
{% if page not in ('settings', 'risk_policy', 'env_config', 'options', 'hedge_plan') %}
{% if page not in ('settings', 'risk_policy', 'env_config', 'options', 'options_review', 'hedge_plan') %}
{% include 'instance_top_bar.html' %}
{% endif %}
@@ -364,6 +367,8 @@
{% include 'strategy_records_page.html' %}
{% elif page == 'options' %}
{% include 'options_panel.html' %}
{% elif page == 'options_review' %}
{% include 'options_review_panel.html' %}
{% elif page == 'hedge_plan' %}
{% include 'hedge_plan_panel.html' %}
{% endif %}