okexswap

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OkexSwap

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

OkexSwap the Okex swap exchange

func NewOkexSwap

func NewOkexSwap(params *Parameters) *OkexSwap

func (*OkexSwap) AmendOrder

func (b *OkexSwap) AmendOrder(symbol string, id string, price float64, size float64, opts ...OrderOption) (result *Order, err error)

func (*OkexSwap) CancelAllOrders

func (b *OkexSwap) CancelAllOrders(symbol string, opts ...OrderOption) (err error)

func (*OkexSwap) CancelOrder

func (b *OkexSwap) CancelOrder(symbol string, id string, opts ...OrderOption) (result *Order, err error)

func (*OkexSwap) CloseLong

func (b *OkexSwap) CloseLong(symbol string, orderType OrderType, price float64, size float64) (result *Order, err error)

func (*OkexSwap) CloseShort

func (b *OkexSwap) CloseShort(symbol string, orderType OrderType, price float64, size float64) (result *Order, err error)

func (*OkexSwap) GetBalance

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

func (*OkexSwap) GetContractID

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

func (*OkexSwap) GetName

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

func (*OkexSwap) GetOpenOrders

func (b *OkexSwap) GetOpenOrders(symbol string, opts ...OrderOption) (result []*Order, err error)

func (*OkexSwap) GetOrder

func (b *OkexSwap) GetOrder(symbol string, id string, opts ...OrderOption) (result *Order, err error)

func (*OkexSwap) GetOrderBook

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

func (*OkexSwap) GetPositions

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

func (*OkexSwap) GetRecords

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

func (*OkexSwap) GetTime

func (b *OkexSwap) GetTime() (tm int64, err error)

func (*OkexSwap) IO

func (b *OkexSwap) IO(name string, params string) (string, error)

func (*OkexSwap) OpenLong

func (b *OkexSwap) OpenLong(symbol string, orderType OrderType, price float64, size float64) (result *Order, err error)

func (*OkexSwap) OpenShort

func (b *OkexSwap) OpenShort(symbol string, orderType OrderType, price float64, size float64) (result *Order, err error)

func (*OkexSwap) PlaceOrder

func (b *OkexSwap) PlaceOrder(symbol string, direction Direction, orderType OrderType, price float64,
	size float64, opts ...PlaceOrderOption) (result *Order, err error)

func (*OkexSwap) SetContractType

func (b *OkexSwap) SetContractType(currencyPair string, contractType string) (err error)

设置合约类型

func (*OkexSwap) SetLeverRate

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

设置杠杆大小

func (*OkexSwap) SubscribeLevel2Snapshots

func (b *OkexSwap) SubscribeLevel2Snapshots(market Market, callback func(ob *OrderBook)) error

func (*OkexSwap) SubscribeOrders

func (b *OkexSwap) SubscribeOrders(market Market, callback func(orders []*Order)) error

func (*OkexSwap) SubscribePositions

func (b *OkexSwap) SubscribePositions(market Market, callback func(positions []*Position)) error

func (*OkexSwap) SubscribeTrades

func (b *OkexSwap) SubscribeTrades(market Market, callback func(trades []*Trade)) error

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

Jump to

Keyboard shortcuts

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