Administrator
63 mins ago e9a397babbbfa9cff8a5ed026447d585e739c37f
refs
author Administrator <15274802129@163.com>
Tuesday, May 12, 2026 21:47 +0800
committer Administrator <15274802129@163.com>
Tuesday, May 12, 2026 21:47 +0800
commite9a397babbbfa9cff8a5ed026447d585e739c37f
tree 830c65ee5bee8aa10c5af7c40bde152031000597 tree | zip | gz
parent 0cfd84ebe2adf4a4616ba72078b135a1797e8cfe view | diff
refactor(gateApi): 将网格交易策略从限价单改为条件单

- 将K线处理器回调方法从onKline(closePx)改为onKline(closePrice, timestamp)
- 仓位更新逻辑调整为基底成交后生成网格队列+止盈队列初始化+挂初始条件单
- 非基底仓位净增时从止盈队列消费止盈价挂止盈条件单
- 保证金超限时跳过挂单但队列照常更新
- 网格触发时匹配队列→更新队列→止盈入队→取消对方旧条件单→挂新多空条件单
- 新增反向条件单机制:价格夹在多空均价间且反向持仓张数小于3时挂反向条件单
- 条件单ID管理改为同步列表(currentLongOrderIds/currentShortOrderIds)
- 止盈条件单改为plan-close-*-position类型,触发后市价平仓
- 文档更新:添加条件单设计说明、参数表格、方法说明和流程图更新
10 files modified
626 ■■■■■ changed files
src/main/java/com/xcong/excoin/modules/gateApi/GateConfig.java 30 ●●●● diff | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/gateApi/GateGridTradeService.java 216 ●●●●● diff | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/gateApi/GateKlineWebSocketClient.java 3 ●●●●● diff | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/gateApi/GateTradeExecutor.java 29 ●●●● diff | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/gateApi/GateWebSocketClientMain.java 5 ●●●●● diff | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/gateApi/GateWebSocketClientManager.java 6 ●●●●● diff | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/gateApi/gateApi-logic.md 318 ●●●●● diff | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/gateApi/wsHandler/handler/CandlestickChannelHandler.java 7 ●●●●● diff | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/gateApi/wsHandler/handler/PositionClosesChannelHandler.java 6 ●●●●● diff | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/gateApi/wsHandler/handler/PositionsChannelHandler.java 6 ●●●●● diff | view | raw | blame | history