Fix strategy roll page JS broken by Jinja in static file.
Pass trading_session via inline page config, restore roll preview/execute handlers, and validate new stop-loss before preview. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -138,7 +138,9 @@
|
||||
<div id="roll-preview" class="strategy-preview" hidden></div>
|
||||
<p class="hint" id="roll-exec-hint" hidden style="font-size:.75rem;margin-top:.45rem">市价加仓:须交易时段内确认,10 秒倒计时执行;突破加仓:休盘也可提交,开盘后再监控触价</p>
|
||||
{% if not trading_session %}
|
||||
<p class="hint text-muted" id="roll-off-session-hint" style="font-size:.75rem;margin-top:.35rem">当前{{ session_clock.status_label or '休盘' }}:请选「突破加仓」填写突破价后预览并提交监控。</p>
|
||||
<p class="hint text-muted" id="roll-off-session-hint" style="font-size:.75rem;margin-top:.35rem">当前{{ session_clock.status_label or '休盘' }}:市价加仓须交易时段内执行;休盘可先预览,或选「突破加仓」提交监控。</p>
|
||||
{% else %}
|
||||
<p class="hint text-muted" id="roll-off-session-hint" hidden style="font-size:.75rem;margin-top:.35rem"></p>
|
||||
{% endif %}
|
||||
</form>
|
||||
{% else %}
|
||||
@@ -211,5 +213,10 @@
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block extra_js %}
|
||||
<script>
|
||||
window.STRATEGY_PAGE = {
|
||||
inTradingSession: {{ 'true' if trading_session else 'false' }}
|
||||
};
|
||||
</script>
|
||||
<script src="{{ url_for('static', filename='js/strategy.js') }}"></script>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user