Documentation ¶
Index ¶
- Constants
- type DepthOrderBook
- type DobItem
- type HbdmSwap
- func (b *HbdmSwap) AmendOrder(symbol string, id string, price float64, size float64, opts ...OrderOption) (result *Order, err error)
- func (b *HbdmSwap) CancelAllOrders(symbol string, opts ...OrderOption) (err error)
- func (b *HbdmSwap) CancelOrder(symbol string, id string, opts ...OrderOption) (result *Order, err error)
- func (b *HbdmSwap) CloseLong(symbol string, orderType OrderType, price float64, size float64) (result *Order, err error)
- func (b *HbdmSwap) CloseShort(symbol string, orderType OrderType, price float64, size float64) (result *Order, err error)
- func (b *HbdmSwap) GetBalance(currency string) (result *Balance, err error)
- func (b *HbdmSwap) GetContractID() (symbol string, err error)
- func (b *HbdmSwap) GetName() (name string)
- func (b *HbdmSwap) GetOpenOrders(symbol string, opts ...OrderOption) (result []*Order, err error)
- func (b *HbdmSwap) GetOrder(symbol string, id string, opts ...OrderOption) (result *Order, err error)
- func (b *HbdmSwap) GetOrderBook(symbol string, depth int) (result *OrderBook, err error)
- func (b *HbdmSwap) GetPositions(symbol string) (result []*Position, err error)
- func (b *HbdmSwap) GetRecords(symbol string, period string, from int64, end int64, limit int) (records []*Record, err error)
- func (b *HbdmSwap) GetTime() (tm int64, err error)
- func (b *HbdmSwap) IO(name string, params string) (string, error)
- func (b *HbdmSwap) OpenLong(symbol string, orderType OrderType, price float64, size float64) (result *Order, err error)
- func (b *HbdmSwap) OpenShort(symbol string, orderType OrderType, price float64, size float64) (result *Order, err error)
- func (b *HbdmSwap) PlaceOrder(symbol string, direction Direction, orderType OrderType, price float64, ...) (result *Order, err error)
- func (b *HbdmSwap) SetContractType(pair string, contractType string) (err error)
- func (b *HbdmSwap) SetLeverRate(value float64) (err error)
- func (b *HbdmSwap) SubscribeLevel2Snapshots(market Market, callback func(ob *OrderBook)) error
- func (b *HbdmSwap) SubscribeOrders(market Market, callback func(orders []*Order)) error
- func (b *HbdmSwap) SubscribePositions(market Market, callback func(positions []*Position)) error
- func (b *HbdmSwap) SubscribeTrades(market Market, callback func(trades []*Trade)) error
- type SwapWebSocket
- func (s *SwapWebSocket) SubscribeLevel2Snapshots(market Market, callback func(ob *OrderBook)) error
- func (s *SwapWebSocket) SubscribeOrders(market Market, callback func(orders []*Order)) error
- func (s *SwapWebSocket) SubscribePositions(market Market, callback func(positions []*Position)) error
- func (s *SwapWebSocket) SubscribeTrades(market Market, callback func(trades []*Trade)) error
Constants ¶
View Source
const StatusOK = "ok"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DepthOrderBook ¶ added in v1.1.7
type DepthOrderBook struct {
// contains filtered or unexported fields
}
func NewDepthOrderBook ¶ added in v1.1.7
func NewDepthOrderBook(symbol string) *DepthOrderBook
func (*DepthOrderBook) GetOrderBook ¶ added in v1.1.7
func (d *DepthOrderBook) GetOrderBook(depth int) (result OrderBook)
func (*DepthOrderBook) GetSymbol ¶ added in v1.1.7
func (d *DepthOrderBook) GetSymbol() string
func (*DepthOrderBook) Update ¶ added in v1.1.7
func (d *DepthOrderBook) Update(data *hbdmswap.WSDepthHF)
type DobItem ¶ added in v1.1.7
func (DobItem) ExtractKey ¶ added in v1.1.7
type HbdmSwap ¶
type HbdmSwap struct {
// contains filtered or unexported fields
}
HbdmSwap the Huobi DM Swap exchange
func NewHbdmSwap ¶
func NewHbdmSwap(params *Parameters) *HbdmSwap
func (*HbdmSwap) AmendOrder ¶
func (*HbdmSwap) CancelAllOrders ¶
func (*HbdmSwap) CancelOrder ¶
func (*HbdmSwap) CloseShort ¶ added in v1.1.3
func (*HbdmSwap) GetBalance ¶
func (*HbdmSwap) GetContractID ¶
func (*HbdmSwap) GetOpenOrders ¶
func (*HbdmSwap) GetOrderBook ¶
func (*HbdmSwap) GetPositions ¶
func (*HbdmSwap) GetRecords ¶
func (*HbdmSwap) PlaceOrder ¶
func (b *HbdmSwap) PlaceOrder(symbol string, direction Direction, orderType OrderType, price float64, size float64, opts ...PlaceOrderOption) (result *Order, err error)
PlaceOrder 下单 params: order_price_type: 订单报价类型 订单报价类型: "limit": 限价 "opponent": 对手价 "post_only":只做maker单 post only下单只受用户持仓数量限制 optimal_5:最优5档 optimal_10:最优10档 optimal_20:最优20档 "fok":FOK订单 "ioc":IOC订单 opponent_ioc": 对手价-IOC下单 "optimal_5_ioc":最优5档-IOC下单 "optimal_10_ioc":最优10档-IOC下单 "optimal_20_ioc":最优20档-IOC下单 "opponent_fok": 对手价-FOK下单 "optimal_5_fok":最优5档-FOK下单 "optimal_10_fok":最优10档-FOK下单 "optimal_20_fok":最优20档-FOK下单
func (*HbdmSwap) SetContractType ¶
设置合约类型
func (*HbdmSwap) SubscribeLevel2Snapshots ¶
func (*HbdmSwap) SubscribeOrders ¶
func (*HbdmSwap) SubscribePositions ¶
func (*HbdmSwap) SubscribeTrades ¶
type SwapWebSocket ¶
type SwapWebSocket struct {
// contains filtered or unexported fields
}
func NewSwapWebSocket ¶
func NewSwapWebSocket(params *Parameters) *SwapWebSocket
func (*SwapWebSocket) SubscribeLevel2Snapshots ¶
func (s *SwapWebSocket) SubscribeLevel2Snapshots(market Market, callback func(ob *OrderBook)) error
func (*SwapWebSocket) SubscribeOrders ¶
func (s *SwapWebSocket) SubscribeOrders(market Market, callback func(orders []*Order)) error
func (*SwapWebSocket) SubscribePositions ¶
func (s *SwapWebSocket) SubscribePositions(market Market, callback func(positions []*Position)) error
func (*SwapWebSocket) SubscribeTrades ¶
func (s *SwapWebSocket) SubscribeTrades(market Market, callback func(trades []*Trade)) error
Click to show internal directories.
Click to hide internal directories.