hbdmswap

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const StatusOK = "ok"

Variables

This section is empty.

Functions

This section is empty.

Types

type HBDMSwap

type HBDMSwap struct {
	// contains filtered or unexported fields
}

HBDMSwap the Huobi DM Swap broker

func New

func New(accessKey string, secretKey string, testnet bool) *HBDMSwap

func (*HBDMSwap) AmendOrder

func (b *HBDMSwap) AmendOrder(symbol string, id string, price float64, size float64) (result Order, err error)

func (*HBDMSwap) CancelAllOrders

func (b *HBDMSwap) CancelAllOrders(symbol string) (err error)

func (*HBDMSwap) CancelOrder

func (b *HBDMSwap) CancelOrder(symbol string, id string) (result Order, err error)

func (*HBDMSwap) GetAccountSummary

func (b *HBDMSwap) GetAccountSummary(currency string) (result AccountSummary, err error)

func (*HBDMSwap) GetContractID

func (b *HBDMSwap) GetContractID() (symbol string, err error)

func (*HBDMSwap) GetName

func (b *HBDMSwap) GetName() (name string)

func (*HBDMSwap) GetOpenOrders

func (b *HBDMSwap) GetOpenOrders(symbol string) (result []Order, err error)

func (*HBDMSwap) GetOrder

func (b *HBDMSwap) GetOrder(symbol string, id string) (result Order, err error)

func (*HBDMSwap) GetOrderBook

func (b *HBDMSwap) GetOrderBook(symbol string, depth int) (result OrderBook, err error)

func (*HBDMSwap) GetPositions added in v1.0.0

func (b *HBDMSwap) GetPositions(symbol string) (result []Position, err error)

func (*HBDMSwap) GetRecords

func (b *HBDMSwap) GetRecords(symbol string, period string, from int64, end int64, limit int) (records []Record, err error)

func (*HBDMSwap) PlaceOrder

func (b *HBDMSwap) 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档 "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) RunEventLoopOnce

func (b *HBDMSwap) RunEventLoopOnce() (err error)

func (*HBDMSwap) SetContractType

func (b *HBDMSwap) SetContractType(pair string, contractType string) (err error)

设置合约类型

func (*HBDMSwap) SetLeverRate

func (b *HBDMSwap) SetLeverRate(value float64) (err error)

设置杠杆大小

func (*HBDMSwap) WS added in v1.0.0

func (b *HBDMSwap) WS() (ws WebSocket, err error)

type WS

type WS struct {
	// contains filtered or unexported fields
}

func NewWS

func NewWS(accessKey string, secretKey string, testnet bool) *WS

func (*WS) On

func (s *WS) On(event WSEvent, listener interface{})

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL