Documentation ¶
Index ¶
- type BitgetSwap
- func (bs *BitgetSwap) FutureCancelOrder(currencyPair CurrencyPair, contractType, orderId string) (bool, error)
- func (bs *BitgetSwap) GetContractInfo(pair CurrencyPair) (*Instrument, error)
- func (bs *BitgetSwap) GetContractValue(currencyPair CurrencyPair) (float64, error)
- func (bs *BitgetSwap) GetDeliveryTime() (int, int, int, int)
- func (bs *BitgetSwap) GetExchangeName() string
- func (bs *BitgetSwap) GetFee() (float64, error)
- func (bs *BitgetSwap) GetFutureDepth(currency CurrencyPair, contractType string, size int) (*Depth, error)
- func (bs *BitgetSwap) GetFutureEstimatedPrice(currencyPair CurrencyPair) (float64, error)
- func (bs *BitgetSwap) GetFutureIndex(currencyPair CurrencyPair) (float64, error)
- func (bs *BitgetSwap) GetFutureOrder(orderId string, currencyPair CurrencyPair, contractType string) (*FutureOrder, error)
- func (bs *BitgetSwap) GetFutureOrders(orderIds []string, currencyPair CurrencyPair, contractType string) ([]FutureOrder, error)
- func (bs *BitgetSwap) GetFuturePosition(currencyPair CurrencyPair, contractType string) ([]FuturePosition, error)
- func (bs *BitgetSwap) GetFutureTicker(currency CurrencyPair, contractType string) (*Ticker, error)
- func (bs *BitgetSwap) GetFutureUserinfo(currencyPair ...CurrencyPair) (*FutureAccount, error)
- func (bs *BitgetSwap) GetInstruments() ([]Instrument, error)
- func (bs *BitgetSwap) GetKlineRecords(contractType string, currency CurrencyPair, period, size, since int) ([]FutureKline, error)
- func (bs *BitgetSwap) GetMarginLevel(currencyPair CurrencyPair) (*MarginLeverage, error)
- func (bs *BitgetSwap) GetServerTime() (int64, error)
- func (bs *BitgetSwap) GetTrades(contractType string, currencyPair CurrencyPair, since int64) ([]Trade, error)
- func (bs *BitgetSwap) GetUnfinishFutureOrders(currencyPair CurrencyPair, contractType string) ([]FutureOrder, error)
- func (bs *BitgetSwap) LimitFuturesOrder(currencyPair CurrencyPair, contractType, price, amount string, openType int, ...) (*FutureOrder, error)
- func (bs *BitgetSwap) MarketFuturesOrder(currencyPair CurrencyPair, contractType, amount string, openType int) (*FutureOrder, error)
- func (bs *BitgetSwap) ModifyAutoAppendMargin(currencyPair CurrencyPair, side int, autoAppend int) (bool, error)
- func (bs *BitgetSwap) PlaceFutureOrder(currencyPair CurrencyPair, contractType, price, amount string, ...) (string, error)
- func (bs *BitgetSwap) PlaceFutureOrder2(currencyPair CurrencyPair, contractType, price, amount string, ...) (*FutureOrder, error)
- func (bs *BitgetSwap) SetBaseUri(uri string)
- func (bs *BitgetSwap) SetMarginLevel(currencyPair CurrencyPair, level, side int) (*MarginLeverage, error)
- type Instrument
- type MarginLeverage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BitgetSwap ¶
type BitgetSwap struct {
// contains filtered or unexported fields
}
func NewSwap ¶
func NewSwap(config *APIConfig) *BitgetSwap
func (*BitgetSwap) FutureCancelOrder ¶
func (bs *BitgetSwap) FutureCancelOrder(currencyPair CurrencyPair, contractType, orderId string) (bool, error)
* * 取消订单 * @param symbol btc_usd:比特币 ltc_usd :莱特币 * @param contractType 合约类型: this_week:当周 next_week:下周 month:当月 quarter:季度 * @param orderId 订单ID
func (*BitgetSwap) GetContractInfo ¶
func (bs *BitgetSwap) GetContractInfo(pair CurrencyPair) (*Instrument, error)
func (*BitgetSwap) GetContractValue ¶
func (bs *BitgetSwap) GetContractValue(currencyPair CurrencyPair) (float64, error)
* *获取每张合约价值
func (*BitgetSwap) GetDeliveryTime ¶
func (bs *BitgetSwap) GetDeliveryTime() (int, int, int, int)
* *获取交割时间 星期(0,1,2,3,4,5,6),小时,分,秒
func (*BitgetSwap) GetExchangeName ¶
func (bs *BitgetSwap) GetExchangeName() string
func (*BitgetSwap) GetFutureDepth ¶
func (bs *BitgetSwap) GetFutureDepth(currency CurrencyPair, contractType string, size int) (*Depth, error)
func (*BitgetSwap) GetFutureEstimatedPrice ¶
func (bs *BitgetSwap) GetFutureEstimatedPrice(currencyPair CurrencyPair) (float64, error)
*
*获取交割预估价
func (*BitgetSwap) GetFutureIndex ¶
func (bs *BitgetSwap) GetFutureIndex(currencyPair CurrencyPair) (float64, error)
* * 期货指数 * @param currencyPair btc_usd:比特币 ltc_usd :莱特币
func (*BitgetSwap) GetFutureOrder ¶
func (bs *BitgetSwap) GetFutureOrder(orderId string, currencyPair CurrencyPair, contractType string) (*FutureOrder, error)
* *获取单个订单信息
func (*BitgetSwap) GetFutureOrders ¶
func (bs *BitgetSwap) GetFutureOrders(orderIds []string, currencyPair CurrencyPair, contractType string) ([]FutureOrder, error)
* *获取订单信息
func (*BitgetSwap) GetFuturePosition ¶
func (bs *BitgetSwap) GetFuturePosition(currencyPair CurrencyPair, contractType string) ([]FuturePosition, error)
* * 用户持仓查询 * @param symbol btc_usd:比特币 ltc_usd :莱特币 * @param contractType 合约类型: this_week:当周 next_week:下周 month:当月 quarter:季度 * @return
func (*BitgetSwap) GetFutureTicker ¶
func (bs *BitgetSwap) GetFutureTicker(currency CurrencyPair, contractType string) (*Ticker, error)
*
- 期货行情
- @param currency_pair btc_usd:比特币 ltc_usd :莱特币
- @param contractType 合约类型: this_week:当周 next_week:下周 month:当月 quarter:季度
func (*BitgetSwap) GetFutureUserinfo ¶
func (bs *BitgetSwap) GetFutureUserinfo(currencyPair ...CurrencyPair) (*FutureAccount, error)
func (*BitgetSwap) GetInstruments ¶
func (bs *BitgetSwap) GetInstruments() ([]Instrument, error)
func (*BitgetSwap) GetKlineRecords ¶
func (bs *BitgetSwap) GetKlineRecords(contractType string, currency CurrencyPair, period, size, since int) ([]FutureKline, error)
* * 获取K线数据
func (*BitgetSwap) GetMarginLevel ¶
func (bs *BitgetSwap) GetMarginLevel(currencyPair CurrencyPair) (*MarginLeverage, error)
func (*BitgetSwap) GetServerTime ¶
func (bs *BitgetSwap) GetServerTime() (int64, error)
func (*BitgetSwap) GetTrades ¶
func (bs *BitgetSwap) GetTrades(contractType string, currencyPair CurrencyPair, since int64) ([]Trade, error)
func (*BitgetSwap) GetUnfinishFutureOrders ¶
func (bs *BitgetSwap) GetUnfinishFutureOrders(currencyPair CurrencyPair, contractType string) ([]FutureOrder, error)
* *获取未完成订单信息
func (*BitgetSwap) LimitFuturesOrder ¶
func (bs *BitgetSwap) LimitFuturesOrder(currencyPair CurrencyPair, contractType, price, amount string, openType int, opt ...LimitOrderOptionalParameter) (*FutureOrder, error)
func (*BitgetSwap) MarketFuturesOrder ¶
func (bs *BitgetSwap) MarketFuturesOrder(currencyPair CurrencyPair, contractType, amount string, openType int) (*FutureOrder, error)
func (*BitgetSwap) ModifyAutoAppendMargin ¶
func (bs *BitgetSwap) ModifyAutoAppendMargin(currencyPair CurrencyPair, side int, autoAppend int) (bool, error)
side 1:多仓 2:空仓 autoAppend追加保证金类型 0 不自动追加 1 自动追加
func (*BitgetSwap) PlaceFutureOrder ¶
func (*BitgetSwap) PlaceFutureOrder2 ¶
func (bs *BitgetSwap) PlaceFutureOrder2(currencyPair CurrencyPair, contractType, price, amount string, openType, matchPrice int, leverRate float64) (*FutureOrder, error)
* * @deprecated * 期货下单 * @param currencyPair btc_usd:比特币 ltc_usd :莱特币 * @param contractType 合约类型: this_week:当周 next_week:下周 month:当月 quarter:季度 * @param price 价格 * @param amount 委托数量 * @param openType 1:开多 2:开空 3:平多 4:平空 * @param matchPrice 是否为对手价 0:不是 1:是 ,当取值为1时,price无效
func (*BitgetSwap) SetBaseUri ¶
func (bs *BitgetSwap) SetBaseUri(uri string)
func (*BitgetSwap) SetMarginLevel ¶
func (bs *BitgetSwap) SetMarginLevel(currencyPair CurrencyPair, level, side int) (*MarginLeverage, error)
side 1:多仓 2:空仓
type Instrument ¶
type Instrument struct { Coin string `json:"coin"` ContractVal string `json:"contract_val"` Delivery []interface{} `json:"delivery"` ForwardContractFlag bool `json:"forwardContractFlag"` Listing interface{} `json:"listing"` PriceEndStep int `json:"priceEndStep"` QuoteCurrency string `json:"quote_currency"` SizeIncrement int `json:"size_increment"` Symbol string `json:"symbol"` TickSize int `json:"tick_size"` UnderlyingIndex string `json:"underlying_index"` }