okexfutures

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OKEXFutures

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

OKEXFutures the OKEX futures broker

func New

func New(params *Parameters) *OKEXFutures

func (*OKEXFutures) AmendOrder

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

func (*OKEXFutures) CancelAllOrders

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

func (*OKEXFutures) CancelOrder

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

func (*OKEXFutures) GetBalance added in v1.1.1

func (b *OKEXFutures) GetBalance(currency string) (result Balance, err error)

func (*OKEXFutures) GetContractID

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

func (*OKEXFutures) GetName

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

func (*OKEXFutures) GetOpenOrders

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

func (*OKEXFutures) GetOrder

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

func (*OKEXFutures) GetOrderBook

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

func (*OKEXFutures) GetPositions added in v1.0.0

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

func (*OKEXFutures) GetRecords

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

func (*OKEXFutures) PlaceOrder

func (b *OKEXFutures) 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)

func (*OKEXFutures) RunEventLoopOnce

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

func (*OKEXFutures) SetContractType

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

设置合约类型 pair: BTC-USD contractType: W1,W2,Q1,Q2,...

func (*OKEXFutures) SetLeverRate

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

设置杠杆大小

func (*OKEXFutures) WS added in v1.0.0

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

type WS

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

func NewWS

func NewWS(params *Parameters) *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