Merge pull request #434 from zhouyongyou/fix/stop-loss-take-profit-separation

fix(trader): separate stop-loss and take-profit order cancellation to prevent accidental deletions
This commit is contained in:
Icyoung
2025-11-05 16:05:00 +08:00
committed by GitHub
4 changed files with 346 additions and 0 deletions

View File

@@ -36,6 +36,16 @@ type Trader interface {
// SetTakeProfit 设置止盈单
SetTakeProfit(symbol string, positionSide string, quantity, takeProfitPrice float64) error
// CancelStopOrders 取消该币种的止盈/止损单(已废弃:会同时删除止损和止盈)
// 请使用 CancelStopLossOrders 或 CancelTakeProfitOrders
CancelStopOrders(symbol string) error
// CancelStopLossOrders 仅取消止损单(修复 BUG调整止损时不删除止盈
CancelStopLossOrders(symbol string) error
// CancelTakeProfitOrders 仅取消止盈单(修复 BUG调整止盈时不删除止损
CancelTakeProfitOrders(symbol string) error
// CancelAllOrders 取消该币种的所有挂单
CancelAllOrders(symbol string) error