jackyu66git and Claude Opus 4.6
b7767c95ae
feat: 添加OKX行情接入+趋势检测+累积变动系统+界面重构
...
- 新增OKX WebSocket行情连接器,扩展4交易所价格监控
- 新增z-score趋势检测引擎(TrendDetector),识别价格异动/趋势启动
- 新增累积变动跟踪(CumulativeTracker),基于1min/5min多交易所共识
- 趋势事件和累积变动事件持久化到SQLite
- 新增Binance/OKX动量检测字段,扩展前端动量卡片至15列
- 迁移至macOS(darwin-arm64),更新前端依赖
- Dashboard网格重构:非交易卡片置顶,交易卡片置底
- TrackedCoin添加OK字段,添加ExBinance/ExOKX常量
- 前端新增趋势检测卡片、趋势历史卡片、累积变动卡片
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-05-06 13:26:05 +08:00
jackyu66git
ce204abc81
fix: remove HL-delisted coins from scanner (BNT/CATI/CYBER/ILV/LISTA/OGN/STG) + PIXEL
...
Root cause: HL WS uses allMids (all coins), BG WS subscribes per-coin.
Delisted coins had stale HL prices showing huge fake spreads (~200%).
Monitor tried entry → BG buy succeeds, HL sell fails (Trading is halted)
→ orphan position on BG accumulated across restarts.
Fix:
- Set HL="" for BNT, CATI, CYBER, ILV, LISTA, OGN, STG, PIXEL
- Add guard in ScanBGHL to skip coins where BG or HL is empty
- Same guard in SpreadWindowTracker.Tick
2026-05-04 23:12:41 +08:00
jackyu66git
9163d7fd30
切换到实盘环境
...
- HL: WS/REST 从 testnet 切换到 mainnet
- BG: 删除 paptrading header(实盘 key 不以 bg_ 前缀区分)
- config: 调整交易参数
- scanner: 更新跟踪币种列表
2026-05-04 22:24:30 +08:00
jackyu66git
411365b66e
fix: correct HL fee parsing (OrderStatus not statuses[]) and add productType to BG fills query
2026-05-04 20:06:27 +08:00
jackyu66git
6e9b982c66
config: lower threshold 0.10->0.05, arb 0.03->0.02, amount 0->0
2026-05-04 19:31:08 +08:00
jackyu66git
49da6fd35b
fix: HL balance now reads spot USDC via SpotUserState
...
HL testnet USDC lives in the spot account, not the perp clearinghouse.
GetBalance() was calling UserState() (perp clearinghouseState), which
returned /usr/bin/bash. Switched to SpotUserState() and parse USDC.total - USDC.hold.
Also cleaned up .gitignore to exclude .env, binary, logs, data/.
2026-05-04 17:48:14 +08:00
jackyu66git
e5ea78ffd2
feat: real trading mode, auto-stop after 5 trades, HL testnet support
...
- config.json: test_mode=false, ready for sim/testnet trading
- trader.go: auto-stop after 5 real trades, exchange response logging,
Stop()/Start() API, shuttingDown flag for graceful stop
- dashboard.go: POST /api/stop + POST /api/start endpoints,
trading status in SSE stats
- exchange/hyperliquid.go: switch HL WS to testnet endpoint
- exchange/hyperliquid_trade.go: switch REST to testnet endpoint,
support base64 + 32-byte EVM private keys
- main.go: listen on trader.StopCh (graceful, no process exit)
- scanner.go: trim TrackedCoins to only 6 core coins (DOGE/LINK/ONDO/OP/WIF/ARB)
- .gitignore: ignore main binary
2026-05-04 14:31:52 +08:00
jackyu66git
e74fd084ce
config: raise trade_threshold to 0.20%, mock_slippage to 0.05%
2026-05-04 13:10:22 +08:00
jackyu66git
21a3f9a962
feat: 所有参数移至config.json, 重构退出逻辑, 清理遗留接口
...
- 将所有硬编码参数迁移到 config.json (手续费率、止盈/止损阈值、
超时、腿间隔、加仓步进等)
- 退出条件: 净利 >= take_profit_pct 止盈, 价差 <= 0 平仓
- 删除 Binance/dYdX 遗留代码
- 更新 README 文档
- Dashboard: 双交易所价格表、黑名单UI、按币名排序持仓
- Bitget WS: 文本ping保活
- 数据库: 重置, 无历史仓位
2026-05-04 01:46:17 +08:00
jackyu66git
02ca8e248c
fix: trade_threshold 0.25 → 0.05 (net profit %)
2026-05-03 23:55:40 +08:00
jackyu66git
5d6d9352f3
fix: use taker fees (BG 0.06%, HL 0.045%) + threshold 0.25%
...
All IOC market orders incur taker fees, not maker fees. Previous
makerFees (BG 0.02%, HL 0.015%) caused 0.10% threshold trades to
actually lose 0.11% per round trip.
Changes:
- scanner.go: makerFees → takerFees (BG 0.060, HL 0.045)
- dashboard.go: makerFees → takerFees
- types.go: makerFees → takerFees
- trader.go: makerFees → takerFees
- config.json: trade_threshold 0.1 → 0.25
2026-05-03 23:34:01 +08:00
jackyu66git
6a4b046742
config.json: add trade_enabled=true
2026-05-03 21:19:07 +08:00
jackyu66git
1e4a3f3b37
Add detailed PnL and duration stats to dashboard
2026-05-03 21:03:40 +08:00