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 }, }