package yu_bitget type PlaceOrderArgs struct { Symbol string `json:"symbol"` // 交易对名称,如:"ethusdt" ProductType string `json:"productType"` // 产品类型 // 仓位模式 // isolated: 逐仓 // crossed: 全仓 MarginMode string `json:"marginMode"` MarginCoin string `json:"marginCoin"` // 保证金币种(大写) Size string `json:"size"` // 下单数量(基础币) Price string `json:"price,omitempty"` // 下单价格,OrderType 为 limit 时必填 // 下单方向 // buy: 买 // sell: 卖 Side string `json:"side"` // 交易方向 // 开平仓,双向持仓模式下必填 // 单向持仓时不要填,否则会报错。 // open: 开 // close: 平 TradeSide string `json:"tradeSide,omitempty"` // 订单类型 // limit: 限价单 // market: 市价单 OrderType string `json:"orderType"` // 订单有效期 // ioc: 无法立即成交的部分就撤销 // fok: 无法全部立即成交就撤销 // gtc: 普通订单,订单会一直有效,直到被成交或者取消 // post_only: 只做 maker,订单类型为限价单时必填,若省略则默认为 gtc Force string `json:"force,omitempty"` ClientOid string `json:"clientOid,omitempty"` // 自定义订单ID, 幂等时间为20分钟 // 是否只减仓 // YES, NO // 默认 NO,仅适用于买卖单向持仓模式时。 ReduceOnly string `json:"reduceOnly,omitempty"` PresetStopSurplusPrice string `json:"presetStopSurplusPrice,omitempty"` // 止盈值,为空则默认不设止盈。 PresetStopLossPrice string `json:"presetStopLossPrice,omitempty"` // 止损值,为空则默认不设止损。 // STP模式(自成交预防) // none: 不设置STP(默认值) // cancel_taker: 取消taker单 // cancel_maker: 取消maker单 // cancel_both: 两者都取消 StpMode string `json:"stpMode,omitempty"` } func (t *V2Rest) PlaceOrder(args PlaceOrderArgs) []*PlaceOrderArgs { j_path, j_resp := "/api/v2/mix/order/place-order", make([]*PlaceOrderArgs, 0) t.request("POST", j_path, args, j_resp) return j_resp }