Documentation ¶
Index ¶
- Constants
- type DepthOrderBook
- type DobItem
- type Hbdm
- func (b *Hbdm) AmendOrder(symbol string, id string, price float64, size float64, opts ...OrderOption) (result *Order, err error)
- func (b *Hbdm) CancelAllOrders(symbol string, opts ...OrderOption) (err error)
- func (b *Hbdm) CancelOrder(symbol string, id string, opts ...OrderOption) (result *Order, err error)
- func (b *Hbdm) CloseLong(symbol string, orderType OrderType, price float64, size float64) (result *Order, err error)
- func (b *Hbdm) CloseShort(symbol string, orderType OrderType, price float64, size float64) (result *Order, err error)
- func (b *Hbdm) GetBalance(currency string) (result *Balance, err error)
- func (b *Hbdm) GetContractID() (symbol string, err error)
- func (b *Hbdm) GetContractInfo(symbol string) (rawSymbol string, contractType string, err error)
- func (b *Hbdm) GetName() (name string)
- func (b *Hbdm) GetOpenOrders(symbol string, opts ...OrderOption) (result []*Order, err error)
- func (b *Hbdm) GetOrder(symbol string, id string, opts ...OrderOption) (result *Order, err error)
- func (b *Hbdm) GetOrderBook(symbol string, depth int) (result *OrderBook, err error)
- func (b *Hbdm) GetPositions(symbol string) (result []*Position, err error)
- func (b *Hbdm) GetRecords(symbol string, period string, from int64, end int64, limit int) (records []*Record, err error)
- func (b *Hbdm) GetTime() (tm int64, err error)
- func (b *Hbdm) OpenLong(symbol string, orderType OrderType, price float64, size float64) (result *Order, err error)
- func (b *Hbdm) OpenShort(symbol string, orderType OrderType, price float64, size float64) (result *Order, err error)
- func (b *Hbdm) PlaceOrder(symbol string, direction Direction, orderType OrderType, price float64, ...) (result *Order, err error)
- func (b *Hbdm) SetContractType(currencyPair string, contractType string) (err error)
- func (b *Hbdm) SetLeverRate(value float64) (err error)
- func (b *Hbdm) SubscribeLevel2Snapshots(market Market, callback func(ob *OrderBook)) error
- func (b *Hbdm) SubscribeOrders(market Market, callback func(orders []*Order)) error
- func (b *Hbdm) SubscribePositions(market Market, callback func(positions []*Position)) error
- func (b *Hbdm) SubscribeTrades(market Market, callback func(trades []*Trade)) error
- type HbdmWebSocket
- func (s *HbdmWebSocket) SubscribeLevel2Snapshots(symbol string, contractType string, callback func(ob *OrderBook)) error
- func (s *HbdmWebSocket) SubscribeOrders(symbol string, contractType string, callback func(orders []*Order)) error
- func (s *HbdmWebSocket) SubscribePositions(symbol string, contractType string, callback func(positions []*Position)) error
- func (s *HbdmWebSocket) SubscribeTrades(symbol string, contractType string, callback func(trades []*Trade)) error
Constants ¶
const StatusOK = "ok"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DepthOrderBook ¶
type DepthOrderBook struct {
// contains filtered or unexported fields
}
func NewDepthOrderBook ¶
func NewDepthOrderBook(symbol string) *DepthOrderBook
func (*DepthOrderBook) GetOrderBook ¶
func (d *DepthOrderBook) GetOrderBook(depth int) (result OrderBook)
func (*DepthOrderBook) GetSymbol ¶
func (d *DepthOrderBook) GetSymbol() string
func (*DepthOrderBook) Update ¶
func (d *DepthOrderBook) Update(data *hbdm.WSDepthHF)
type DobItem ¶
func (DobItem) ExtractKey ¶
type Hbdm ¶
type Hbdm struct {
// contains filtered or unexported fields
}
Hbdm the Huobi DM exchange
func (*Hbdm) AmendOrder ¶
func (*Hbdm) CancelAllOrders ¶
func (*Hbdm) CancelOrder ¶
func (*Hbdm) CloseShort ¶
func (*Hbdm) GetBalance ¶
func (*Hbdm) GetContractID ¶
func (*Hbdm) GetContractInfo ¶
func (*Hbdm) GetOpenOrders ¶
func (*Hbdm) GetOrderBook ¶
func (*Hbdm) GetPositions ¶
func (*Hbdm) GetRecords ¶
func (*Hbdm) PlaceOrder ¶
func (b *Hbdm) 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档 ioc: IOC订单 fok:FOK订单 "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下单 ----------------------------------------------------- 对手价下单price价格参数不用传,对手价下单价格是买一和卖一价 optimal_5:最优5档、optimal_10:最优10档、optimal_20:最优20档下单price价格参数不用传 "limit":限价,"post_only":只做maker单 需要传价格 "fok":全部成交或立即取消,"ioc":立即成交并取消剩余。
func (*Hbdm) SetContractType ¶
设置合约类型 currencyPair: BTC/ETH/...
func (*Hbdm) SubscribeLevel2Snapshots ¶
func (*Hbdm) SubscribeOrders ¶
func (*Hbdm) SubscribePositions ¶
func (*Hbdm) SubscribeTrades ¶
type HbdmWebSocket ¶
type HbdmWebSocket struct {
// contains filtered or unexported fields
}
func NewHbdmWebSocket ¶
func NewHbdmWebSocket(params *Parameters) *HbdmWebSocket
func (*HbdmWebSocket) SubscribeLevel2Snapshots ¶
func (s *HbdmWebSocket) SubscribeLevel2Snapshots(symbol string, contractType string, callback func(ob *OrderBook)) error
func (*HbdmWebSocket) SubscribeOrders ¶
func (s *HbdmWebSocket) SubscribeOrders(symbol string, contractType string, callback func(orders []*Order)) error
func (*HbdmWebSocket) SubscribePositions ¶
func (s *HbdmWebSocket) SubscribePositions(symbol string, contractType string, callback func(positions []*Position)) error
func (*HbdmWebSocket) SubscribeTrades ¶
func (s *HbdmWebSocket) SubscribeTrades(symbol string, contractType string, callback func(trades []*Trade)) error