Documentation ¶
Index ¶
- Constants
- type HBDM
- func (b *HBDM) AmendOrder(symbol string, id string, price float64, size float64) (result Order, err error)
- func (b *HBDM) CancelAllOrders(symbol string) (err error)
- func (b *HBDM) CancelOrder(symbol string, id string) (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) GetName() (name string)
- func (b *HBDM) GetOpenOrders(symbol string) (result []Order, err error)
- func (b *HBDM) GetOrder(symbol string, id string) (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) PlaceOrder(symbol string, direction Direction, orderType OrderType, price float64, ...) (result Order, err error)
- func (b *HBDM) RunEventLoopOnce() (err error)
- func (b *HBDM) SetContractType(pair string, contractType string) (err error)
- func (b *HBDM) SetLeverRate(value float64) (err error)
- func (b *HBDM) WS() (ws WebSocket, err error)
- type WS
Constants ¶
const StatusOK = "ok"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HBDM ¶
type HBDM struct {
// contains filtered or unexported fields
}
HBDM the Huobi DM broker
func (*HBDM) AmendOrder ¶
func (*HBDM) CancelAllOrders ¶
func (*HBDM) CancelOrder ¶
func (*HBDM) GetBalance ¶ added in v1.1.1
func (*HBDM) GetContractID ¶
func (*HBDM) GetOpenOrders ¶
func (*HBDM) GetOrderBook ¶
func (*HBDM) GetPositions ¶ added in v1.0.0
func (*HBDM) GetRecords ¶
func (*HBDM) PlaceOrder ¶
func (b *HBDM) PlaceOrder(symbol string, direction Direction, orderType OrderType, price float64, stopPx float64, size float64, postOnly bool, reduceOnly bool, params map[string]interface{}) (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) RunEventLoopOnce ¶
func (*HBDM) SetContractType ¶
设置合约类型 pair: BTC/ETH/...
type WS ¶
type WS struct {
// contains filtered or unexported fields
}
func (*WS) SubscribeLevel2Snapshots ¶
func (s *WS) SubscribeLevel2Snapshots(market Market)
func (*WS) SubscribeOrders ¶
func (s *WS) SubscribeOrders(market Market)
func (*WS) SubscribePositions ¶
func (s *WS) SubscribePositions(market Market)
func (*WS) SubscribeTrades ¶
func (s *WS) SubscribeTrades(market Market)