Back to godoc.org

Package ocx

v1.1.3
Latest Go to latest

The highest tagged major version is .

Published: Jan 15, 2020 | License: MIT | Module: code.dllexport.com/mario/goex.git

Index

Constants

const (
	API_BASE_URL = "https://openapi.ocx.com"
	V2           = "/api/v2/"

	TICKER_API  = "market/ticker/%s"
	TICKERS_API = "market/tickers"
	DEPTH_API   = "depth?market_code=%s"
	SERVER_TIME = "timestamp"

	TRADE_URL       = "orders"
	GET_ACCOUNT_API = "accounts"
	GET_ORDER_API   = "orders/%s"

	CANCEL_ORDER_API     = "orders/:%s/cancel"
	CANCEL_ALL_ORDER_API = "orders/clear"

	PLACE_ORDER_API = "orders"
)

Variables

var TimeOffset int64 = 0

type Ocx

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

func New

func New(client *http.Client, apikey, secretkey string) *Ocx

func (*Ocx) CancelOrder

func (o *Ocx) CancelOrder(orderId string, currency CurrencyPair) (bool, error)

func (*Ocx) GetAccount

func (o *Ocx) GetAccount() (*Account, error)

func (*Ocx) GetDepth

func (o *Ocx) GetDepth(size int, currency CurrencyPair) (*Depth, error)

func (*Ocx) GetExchangeName

func (o *Ocx) GetExchangeName() string

func (*Ocx) GetKlineRecords

func (o *Ocx) GetKlineRecords(currency CurrencyPair, period, size, since int) ([]Kline, error)

func (*Ocx) GetOneOrder

func (o *Ocx) GetOneOrder(orderId string, currency CurrencyPair) (*Order, error)

func (*Ocx) GetOrderHistorys

func (o *Ocx) GetOrderHistorys(currency CurrencyPair, currentPage, pageSize int) ([]Order, error)

func (*Ocx) GetOrdersList

func (o *Ocx) GetOrdersList()

func (*Ocx) GetServerTime

func (o *Ocx) GetServerTime() int64

func (*Ocx) GetTicker

func (o *Ocx) GetTicker(currencyPair CurrencyPair) (*Ticker, error)

func (*Ocx) GetTrades

func (o *Ocx) GetTrades(currencyPair CurrencyPair, since int64) ([]Trade, error)

非个人,整个交易所的交易记录

func (*Ocx) GetUnfinishOrders

func (o *Ocx) GetUnfinishOrders(currency CurrencyPair) ([]Order, error)

func (*Ocx) LimitBuy

func (o *Ocx) LimitBuy(amount, price string, currency CurrencyPair) (*Order, error)

func (*Ocx) LimitSell

func (o *Ocx) LimitSell(amount, price string, currency CurrencyPair) (*Order, error)

func (*Ocx) MarketBuy

func (o *Ocx) MarketBuy(amount, price string, currency CurrencyPair) (*Order, error)

func (*Ocx) MarketSell

func (o *Ocx) MarketSell(amount, price string, currency CurrencyPair) (*Order, error)

Package Files

  • ocx.go
Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier