From 4097ef07c0b62e4b2120d5296d3d86b9bfbd487e Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Wed, 23 Sep 2026 11:48:47 +0800
Subject: [PATCH] feat(stations): 添加止盈触发对向加仓功能

---
 src/main/resources/db/station-schema.sql |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/main/resources/db/station-schema.sql b/src/main/resources/db/station-schema.sql
index 39280f9..0347ff6 100644
--- a/src/main/resources/db/station-schema.sql
+++ b/src/main/resources/db/station-schema.sql
@@ -26,6 +26,8 @@
     `dual_stop_loss_enabled`     TINYINT(1)   DEFAULT 0  COMMENT '双开止损触发开关',
     `long_stop_loss_price`       VARCHAR(32)  DEFAULT NULL COMMENT '多头止损触发价',
     `short_stop_loss_price`      VARCHAR(32)  DEFAULT NULL COMMENT '空头止损触发价',
+    `tp_trigger_opposite_add_enabled`  TINYINT(1) DEFAULT 0 COMMENT '止盈成交触发对向加仓开关',
+    `tp_trigger_opposite_add_quantity` INT(11)   DEFAULT 0 COMMENT '对向加仓挂单数量',
     `current_round`  INT(11)      DEFAULT 0  COMMENT '当前轮次',
     `total_rounds`   INT(11)      DEFAULT 0  COMMENT '总轮数上限',
     `accumulated_long_loss`       INT(11)      DEFAULT 0  COMMENT '多头累计止损次数',
@@ -97,3 +99,10 @@
 -- 旧数据迁移:1(开启)→concentrated,0(关闭)→off
 UPDATE `strategy_status` SET `place_excess_take_profit` = 'concentrated' WHERE `place_excess_take_profit` = '1';
 UPDATE `strategy_status` SET `place_excess_take_profit` = 'off' WHERE `place_excess_take_profit` = '0';
+
+-- ============================================================
+-- 升级脚本:止盈成交触发对向加仓(2026-09 新增)
+-- ============================================================
+ALTER TABLE `strategy_status`
+    ADD COLUMN `tp_trigger_opposite_add_enabled`  TINYINT(1) DEFAULT 0 COMMENT '止盈成交触发对向加仓开关' AFTER `short_stop_loss_price`,
+    ADD COLUMN `tp_trigger_opposite_add_quantity` INT(11)   DEFAULT 0 COMMENT '对向加仓挂单数量' AFTER `tp_trigger_opposite_add_enabled`;

--
Gitblit v1.9.1