Commit Graph

48 Commits

Author SHA1 Message Date
dekun 24270944e7 fix(hub,gate): cross-margin TP/SL and dedupe hub conditional orders
Gate hedge position triggers use close=false; stop silent ccxt fallback on cross margin. Hub merges agent and Flask TP/SL by trigger price and labels Gate orders correctly.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 19:48:04 +08:00
dekun 93e148a3e7 fix: unify order/key focus K-line theme, PnL, RR and exchange price tick
Share focus_chart templates and APIs across four instances; align chart Y-axis, price lines and meta bar with exchange symbol precision and live unrealized PnL.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 16:45:51 +08:00
dekun 3d55aa0975 fix(gate-bot): format mark price with exchange symbol precision
Use price_to_precision in price_snapshot so live mark price matches entry/SL display instead of fixed 8 decimals.
2026-06-04 16:33:09 +08:00
dekun 88fc21e278 fix(gate-bot): allow profit-side stop loss on TP/SL entrust
Skip min planned RR when stop is on the winning side of entry; validate entrust against open price and fall back to plan take-profit when omitted.
2026-06-04 16:28:47 +08:00
dekun 1042f135ed fix(gate-bot): PnL colors, sync exchange TP/SL to plan display
Color floating PnL on position cards, mirror exchange stop/take prices in the grid and DB, and purge false external-close records on monitor relink.
2026-06-04 16:23:52 +08:00
dekun 1618ef8668 fix(gate-bot): show orphan exchange positions and relink monitor
When the exchange still has a position but order_monitors is not active, surface it on the trade page and allow restoring the latest stopped record.
2026-06-04 16:17:34 +08:00
dekun e327f1b1fb feat(gate-bot): align order monitor with Gate main site
Dual-panel trade UI, exchange TP/SL entrust modal, and place/cancel_tpsl APIs so bot manual trading matches Gate.
2026-06-04 16:09:17 +08:00
dekun f9301b92b9 feat(hub): trend plan breakeven and stop from monitor fullscreen
Proxy /api/hub/trend/stop and breakeven to instances; enable offset input and actions in hub UI. Add horizontal padding on strategy records page.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 14:46:24 +08:00
dekun 52d97482f2 feat(strategy): WeChat notify on trend and roll plan start/end
Add shared strategy_wechat_notify helpers; hook trend execute/finalize and roll group open/close across four exchanges and Gate bot.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 13:35:21 +08:00
dekun 3fb2023efb feat: strategy trade snapshots, DCA detail, and hub trend layout
Persist ended trend pullback and roll group snapshots to a unified records page; show replenishment tiers on instance and hub cards with horizontal single-position layout.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 10:45:27 +08:00
dekun 29b0634c6d feat: bidirectional daily auto-transfer with position skip
Rebalance swap to AUTO_TRANSFER_AMOUNT at Beijing hour: top up from funding or sweep excess back. Skip and WeChat notify when active positions exist.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 09:57:25 +08:00
dekun f7bac11694 feat: add full-margin position sizing mode across four exchanges
Env POSITION_SIZING_MODE switches risk vs full-margin (available*buffer, BTC/ETH 10x). Blocks trend/roll/key auto opens in full margin, purges breakout/fib monitors with WeChat notice, keeps RR check and initial SL snapshot for records.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 08:24:35 +08:00
dekun 1b3f661bad fix: label trend breakeven handoff as 趋势回调 across four exchanges
Set order monitor and trade record source to trend pullback after handoff; unify hub and instance display; add migration script for legacy rows.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 06:30:14 +08:00
dekun d07357b98e fix(hub): merge mark price from Flask snapshot and fix board refresh
Sync hub positions with instance price_snapshot (order_prices and position_marks).
Fix monitor board UI when hub restarts (version rewind) and queue snapshot fetches.
Expose board aggregate status on /api/ping for diagnostics.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 22:44:01 +08:00
dekun e2bf58cfd3 feat(trend): 趋势回调保本移交下单监控并统一写交易记录
保本后结束趋势计划,持仓转入下单监控(备注趋势回调),交易所同时挂保本止损与计划止盈;中控或交易所平仓均经下单监控写入交易记录(trend_plan_id、开仓类型),四所共用 strategy_trend_register。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 17:01:34 +08:00
dekun cf3e2ee1c9 feat: 持仓快照盈亏比与交易所止损已保本标识
盈亏比固定用开仓 initial_stop_loss 计算,人工改委托后不变化;轮询交易所止损触发价相对成交价判定已保本,四所实例与中控统一显示绿色标识。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 16:31:03 +08:00
dekun ba681c7a58 中控行情区与 K 线本地库(15 天滚动、按需拉取)
新增行情区单图与周期切换,K 线优先读 hub_kline.db,不足时经各实例 /api/hub/ohlcv 补齐;无后台定时更新。含回滚标签说明与单元测试。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 10:58:59 +08:00
dekun 81f27765ca 修复趋势回调顺势加仓的交易记录 2026-05-29 18:39:40 +08:00
dekun 7af2717331 修复趋势回调企业微信推送 2026-05-29 17:48:19 +08:00
dekun 0b1b5d7672 修复交易记录bug 2026-05-28 22:47:18 +08:00
dekun 33042890b5 修复滚仓 2026-05-28 14:43:15 +08:00
dekun aa92952b2d 移除一键保本bug 2026-05-28 12:43:55 +08:00
dekun 96dd4a041c 增加一键保本 2026-05-28 12:31:16 +08:00
dekun b2b6aac094 修改支撑阻力的企业微信推送 2026-05-28 11:54:37 +08:00
dekun fe068709ac 修改 2026-05-27 22:35:51 +08:00
dekun bb8aca0cb3 修改 2026-05-27 16:32:30 +08:00
dekun b9af1f69fe 修复ai 2026-05-27 16:13:23 +08:00
dekun 6093bf6b94 修改 2026-05-27 15:32:46 +08:00
dekun 7bb3f942ed 修改 2026-05-27 15:22:40 +08:00
dekun ada9478713 修复web前端,增加openai 2026-05-23 11:53:36 +08:00
dekun fc8f9b70da 修改ui 2026-05-23 11:20:45 +08:00
dekun c0f4fc5735 修复策略交易 2026-05-23 10:57:08 +08:00
dekun 103615d7a9 增加策略交易 2026-05-23 10:48:50 +08:00
dekun 8b3ab87715 修复前端 2026-05-22 11:12:00 +08:00
dekun 40f7a1b844 修复关键位 2026-05-22 10:56:42 +08:00
dekun 46f73fce43 中控增加下单,关键位,系统设置 2026-05-22 10:04:28 +08:00
dekun ed6b56ff87 修复bot前端 2026-05-21 22:05:36 +08:00
dekun f7dce1a004 修复复盘 2026-05-21 20:12:25 +08:00
dekun 2301590a97 修复k线图开平仓 2026-05-21 10:20:50 +08:00
dekun 4f0243e4fe 修复一些bug 2026-05-21 10:08:27 +08:00
dekun 86e8ed6888 bot修改开仓限制 2026-05-21 06:55:25 +08:00
dekun ee38eb1c45 修改企业微信 2026-05-19 20:48:57 +08:00
dekun 44432a0688 bot增加保本 2026-05-19 15:20:14 +08:00
dekun 5af1251687 修改移动止损 2026-05-19 14:45:28 +08:00
dekun 3a06b22142 更新bot前端显示 2026-05-18 20:10:44 +08:00
dekun a86d1a44dd bot统计 2026-05-15 22:04:00 +08:00
dekun 7978d40a74 修改币种精度 2026-05-14 11:30:52 +08:00
dekun 5900588718 增加新账户 2026-05-12 18:27:35 +08:00