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
+18 -1
View File
@@ -5312,6 +5312,15 @@ def render_main_page(page="trade"):
trend_preview_levels.append({"i": i, "price": pair[0], "contracts": pair[1]})
elif pr:
trend_preview_expired = True
strategy_extra = {}
if page == "strategy_roll":
from strategy_ui import fetch_roll_page_data
strategy_extra = fetch_roll_page_data(
conn,
default_risk_percent=float(RISK_PERCENT),
count_active_trends=lambda c, ta=trend_active: int(ta or 0),
)
conn.close()
return render_template(
"index.html",
@@ -5376,6 +5385,7 @@ def render_main_page(page="trade"):
entry_reason_options=list(ENTRY_REASON_OPTIONS),
entry_reason_other_value=ENTRY_REASON_OTHER,
exchange_display=EXCHANGE_DISPLAY_NAME,
**strategy_extra,
)
@@ -7371,10 +7381,18 @@ except Exception as _hub_err:
print(f"[hub_bridge] gate_bot: {_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(
@@ -7382,7 +7400,6 @@ install_strategy_trading(
_REPO_ROOT,
app_module=sys.modules[__name__],
trend_enabled=True,
render_trend_page=login_required(strategy_trend_page),
)