Add auto break-even toggle and WeCom hub notifications.

Desktop can auto-pull stop to open+/-1 after a 3$ favorable move; hub pushes open/close events and a 23:00 BJT daily summary via webhook.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-10-27 11:25:44 +08:00
parent 828038a5ae
commit 75b9bffe96
13 changed files with 582 additions and 5 deletions
+35
View File
@@ -35,4 +35,39 @@
<p class="muted" style="margin-top:12px">通用 exe 放置目录:<code>releases/黄金市价辅助.exe</code></p>
</div>
</div>
{% if is_admin %}
<div class="card" style="margin-top:16px">
<h3>企业微信推送</h3>
<p class="muted">
群机器人 Webhook:开仓/平仓即时推送;北京时间
{{ '%02d'|format(wecom.daily_hour|int) }}:{{ '%02d'|format((wecom.daily_minute or 0)|int) }}
推送各账户日报(交易次数、已平盈亏、胜率)。
</p>
<form method="post" action="{{ url_for('settings_wecom') }}" style="margin-top:12px">
<div class="form-row">
<label>
<input type="checkbox" name="enabled" value="1" {% if wecom.enabled %}checked{% endif %}>
启用推送
</label>
</div>
<div class="form-row">
<label>Webhook 地址</label>
<input name="webhook" value="{{ wecom.webhook }}" placeholder="https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=..." style="width:100%">
</div>
<button class="btn" type="submit">保存</button>
</form>
<div style="margin-top:12px;display:flex;gap:8px;flex-wrap:wrap">
<form method="post" action="{{ url_for('settings_wecom_test') }}">
<button class="btn secondary" type="submit">发送测试消息</button>
</form>
<form method="post" action="{{ url_for('settings_wecom_daily') }}">
<button class="btn secondary" type="submit">立即推送今日日报</button>
</form>
</div>
{% if wecom.daily_last %}
<p class="muted" style="margin-top:10px">上次自动日报日期:{{ wecom.daily_last }}</p>
{% endif %}
</div>
{% endif %}
{% endblock %}