Documentation ¶
Index ¶
- func FlateDecompress(data []byte) ([]byte, error)
- func HmacSha256Base64Signer(message string, secretKey string) (string, error)
- type Api
- func (self *Api) Candles(instId, bar, before string) [][]string
- func (self *Api) EstimatedPrice(instId string) []*EstimatedPrice
- func (self *Api) ExchangeRate() []*UsdCny
- func (self *Api) InitApiKeys(apikey, secretkey, passphrase string)
- func (self *Api) Instruments(instType, uly, instId string) []*Instrument
- func (self *Api) Order(instId, tdMode, side, posSide string, px, sz float32) []*OrderRes
- func (self *Api) PriceLimit(instId string) []*PriceLimit
- func (self *Api) SysTime() []*SysTime
- func (self *Api) Ticker(instId string) []*Ticker
- func (self *Api) Tickers(instType, uly string) []*Ticker
- type Balance
- type Base
- func (self *Base) Balance(symbol conset.SYMBOL) float32
- func (self *Base) Init(strings []string)
- func (self *Base) Orders(symbol conset.SYMBOL, period conset.PERIOD, direct conset.OPERATION, ...) bool
- func (self *Base) Period(period conset.PERIOD) string
- func (self *Base) Plat() conset.PLAT
- func (self *Base) Price(symbol conset.SYMBOL) float32
- func (self *Base) Pull(symbol conset.SYMBOL, times conset.TIMES, start time.Time) bool
- func (self *Base) SetLeverage(symbol conset.SYMBOL, period conset.PERIOD, direct conset.OPERATION, ...) bool
- func (self *Base) Side(direct conset.OPERATION) (string, string)
- func (self *Base) SubscribeTickers(symbols []conset.SYMBOL, f func(conset.SYMBOL, float32))
- func (self *Base) Symbol(symbol conset.SYMBOL) string
- func (self *Base) TdMode(period conset.PERIOD) string
- func (self *Base) Times(times conset.TIMES) string
- func (self *Base) UsdCny() float32
- type Candle
- type EstimatedPrice
- type Instrument
- type OrderRes
- type PriceLimit
- type Response
- type SetLeverage
- type SysTime
- type Ticker
- type UsdCny
- type Ws
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FlateDecompress ¶
Types ¶
type Api ¶
func (*Api) Candles ¶
获取所有交易产品K线数据 获取K线数据。K线数据按请求的粒度分组返回,K线数据每个粒度最多可获取最近1440条。 bar 1m/3m/5m/15m/30m/1H/2H/4H/6H/12H/1D/1W/1M/3M/6M/1Y
func (*Api) EstimatedPrice ¶
func (self *Api) EstimatedPrice(instId string) []*EstimatedPrice
获取预估交割/行权价格 获取交割合约和期权预估交割/行权价。交割/行权预估价只有交割/行权前一小时才有返回值
func (*Api) InitApiKeys ¶
初始化 Key
func (*Api) Instruments ¶
func (self *Api) Instruments(instType, uly, instId string) []*Instrument
获取所有可交易产品的信息列表
func (*Api) Order ¶
交易数量,表示要购买或者出售的数量。 当币币/币币杠杆以限价买入和卖出时,指交易货币数量。 当币币/币币杠杆以市价买入时,指计价货币的数量。 当币币/币币杠杆以市价卖出时,指交易货币的数量。 当交割、永续、期权买入和卖出时,指合约张数。
func (*Api) PriceLimit ¶
func (self *Api) PriceLimit(instId string) []*PriceLimit
查询单个交易产品的最高买价和最低卖价 仅适用于交割/永续/期权
type Balance ¶
type Balance struct { AdjEq string `json:"adjEq"` Details []struct { AvailBal string `json:"availBal"` AvailEq string `json:"availEq"` CashBal string `json:"cashBal"` Ccy string `json:"ccy"` CrossLiab string `json:"crossLiab"` DisEq string `json:"disEq"` Eq string `json:"eq"` EqUsd string `json:"eqUsd"` FrozenBal string `json:"frozenBal"` Interest string `json:"interest"` IsoEq string `json:"isoEq"` IsoLiab string `json:"isoLiab"` IsoUpl string `json:"isoUpl"` Liab string `json:"liab"` MaxLoan string `json:"maxLoan"` MgnRatio string `json:"mgnRatio"` NotionalLever string `json:"notionalLever"` OrdFrozen string `json:"ordFrozen"` Twap string `json:"twap"` UTime string `json:"uTime"` Upl string `json:"upl"` UplLiab string `json:"uplLiab"` StgyEq string `json:"stgyEq"` } `json:"details"` Imr string `json:"imr"` IsoEq string `json:"isoEq"` MgnRatio string `json:"mgnRatio"` Mmr string `json:"mmr"` NotionalUsd string `json:"notionalUsd"` OrdFroz string `json:"ordFroz"` TotalEq string `json:"totalEq"` UTime string `json:"uTime"` }
type Base ¶
func (*Base) SetLeverage ¶
func (*Base) SubscribeTickers ¶
type EstimatedPrice ¶
type Instrument ¶
type Instrument struct { InstType string `json:"instType"` InstID string `json:"instId"` Uly string `json:"uly"` Category string `json:"category"` BaseCcy string `json:"baseCcy"` QuoteCcy string `json:"quoteCcy"` SettleCcy string `json:"settleCcy"` CtVal string `json:"ctVal"` CtMult string `json:"ctMult"` CtValCcy string `json:"ctValCcy"` OptType string `json:"optType"` Stk string `json:"stk"` ListTime string `json:"listTime"` ExpTime string `json:"expTime"` Lever string `json:"lever"` TickSz string `json:"tickSz"` LotSz string `json:"lotSz"` MinSz string `json:"minSz"` CtType string `json:"ctType"` Alias string `json:"alias"` State string `json:"state"` }
type PriceLimit ¶
type SetLeverage ¶
type Ticker ¶
type Ticker struct { InstType string `json:"instType"` InstID string `json:"instId"` Last string `json:"last"` LastSz string `json:"lastSz"` AskPx string `json:"askPx"` AskSz string `json:"askSz"` BidPx string `json:"bidPx"` BidSz string `json:"bidSz"` Open24H string `json:"open24h"` High24H string `json:"high24h"` Low24H string `json:"low24h"` VolCcy24H string `json:"volCcy24h"` Vol24H string `json:"vol24h"` Ts string `json:"ts"` SodUtc0 string `json:"sodUtc0"` SodUtc8 string `json:"sodUtc8"` }
Click to show internal directories.
Click to hide internal directories.