This commit is contained in:
dekun
2026-05-23 11:20:45 +08:00
parent 4b185133c4
commit fc8f9b70da
14 changed files with 294 additions and 79 deletions
+20
View File
@@ -4192,6 +4192,13 @@ def render_main_page(page="trade"):
f"自动开仓盈亏比 > {KEY_AUTO_MIN_PLANNED_RR}:1|日成交量排名前 {KEY_DAILY_VOLUME_RANK_MAX}"
f"斐波:添加后立即挂限价 @ E,失效按标记价触达 H/L(未成交撤单)"
)
strategy_extra = {}
if page in ("strategy_trend", "strategy_roll"):
from strategy_ui import strategy_page_template_vars
strategy_extra = strategy_page_template_vars(
conn, page, default_risk_percent=float(RISK_PERCENT)
)
conn.close()
return render_template(
"index.html",
@@ -4242,6 +4249,7 @@ def render_main_page(page="trade"):
entry_reason_other_value=ENTRY_REASON_OTHER,
key_gate_rule_text=key_gate_rule_text,
key_auto_min_planned_rr=KEY_AUTO_MIN_PLANNED_RR,
**strategy_extra,
)
@@ -5950,6 +5958,18 @@ except Exception as _hub_err:
print(f"[hub_bridge] okx: {_hub_err}")
@app.route("/strategy/trend")
@login_required
def strategy_trend_page():
return render_main_page("strategy_trend")
@app.route("/strategy/roll")
@login_required
def strategy_roll_page():
return render_main_page("strategy_roll")
from strategy_register import install_strategy_trading
install_strategy_trading(app, _REPO_ROOT, app_module=sys.modules[__name__])
+5 -2
View File
@@ -154,8 +154,7 @@
<div class="header"><h1>加密货币|交易监控 + AI复盘一体化</h1></div>
<div class="top-nav">
<a href="/trade" class="{% if page == 'trade' %}active{% endif %}">交易执行</a>
<a href="/strategy/trend" class="{% if page == 'strategy_trend' %}active{% endif %}">策略·趋势回调</a>
<a href="/strategy/roll" class="{% if page == 'strategy_roll' %}active{% endif %}">策略·顺势加仓</a>
<a href="/strategy/trend" class="{% if page in ('strategy_trend', 'strategy_roll') %}active{% endif %}">策略交易</a>
<a href="/records" class="{% if page == 'records' %}active{% endif %}">交易记录与复盘</a>
<a href="/stats" class="{% if page == 'stats' %}active{% endif %}">统计分析</a>
</div>
@@ -353,6 +352,10 @@
{% endfor %}
</div>
</div>
{% elif page == 'strategy_trend' %}
{% include 'strategy_trend_disabled_panel.html' %}
{% elif page == 'strategy_roll' %}
{% include 'strategy_roll_panel.html' %}
{% endif %}
{% if page == 'records' %}