From a5c4d350748b70cab90c4473dbf6168d38175deb Mon Sep 17 00:00:00 2001 From: tinkle-community Date: Tue, 3 Feb 2026 12:40:53 +0800 Subject: [PATCH] refactor: clean up gate trader configuration --- trader/gate/trader.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/trader/gate/trader.go b/trader/gate/trader.go index 636ba6ec..5b9e7706 100644 --- a/trader/gate/trader.go +++ b/trader/gate/trader.go @@ -37,6 +37,7 @@ type GateTrader struct { // NewGateTrader creates a new Gate trader instance func NewGateTrader(apiKey, secretKey string) *GateTrader { config := gateapi.NewConfiguration() + config.AddDefaultHeader("X-Gate-Channel-Id", "nofx") client := gateapi.NewAPIClient(config) ctx := context.WithValue(context.Background(), @@ -550,10 +551,10 @@ func (t *GateTrader) SetStopLoss(symbol string, positionSide string, quantity, s Close: true, }, Trigger: gateapi.FuturesPriceTrigger{ - StrategyType: 0, // Close position - PriceType: 0, // Latest price + StrategyType: 0, // Close position + PriceType: 0, // Latest price Price: fmt.Sprintf("%.8f", stopPrice), - Rule: 1, // Price <= trigger price + Rule: 1, // Price <= trigger price }, } @@ -601,10 +602,10 @@ func (t *GateTrader) SetTakeProfit(symbol string, positionSide string, quantity, Close: true, }, Trigger: gateapi.FuturesPriceTrigger{ - StrategyType: 0, // Close position - PriceType: 0, // Latest price + StrategyType: 0, // Close position + PriceType: 0, // Latest price Price: fmt.Sprintf("%.8f", takeProfitPrice), - Rule: 2, // Price >= trigger price for long take profit + Rule: 2, // Price >= trigger price for long take profit }, }