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
@@ -5661,6 +5661,13 @@ def render_main_page(page="trade"):
f"箱体/收敛可选 SL/TP 方案(标准 / 箱体1R·止盈1.5H / 趋势单+自填止盈)|移动保本默认关|"
f"斐波:限价 @ E(SL/TP 为 H/L),可选移动保本|趋势止损外侧 {KEY_TREND_STOP_OUTSIDE_PCT}%"
)
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",
@@ -5718,6 +5725,7 @@ def render_main_page(page="trade"):
key_gate_rule_text=key_gate_rule_text,
kline_timeframe=KLINE_TIMEFRAME,
exchange_pnl_sync=exchange_pnl_sync,
**strategy_extra,
)
@@ -7735,6 +7743,18 @@ except Exception as _hub_err:
print(f"[hub_bridge] gate: {_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
@@ -218,8 +218,7 @@
<div class="top-nav">
<a href="/key_monitor" class="{% if page == 'key_monitor' %}active{% endif %}">关键位监控</a>
<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>
@@ -540,6 +539,10 @@
</div>
</div>
{% elif page == 'strategy_trend' %}
{% include 'strategy_trend_disabled_panel.html' %}
{% elif page == 'strategy_roll' %}
{% include 'strategy_roll_panel.html' %}
{% endif %}