api

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2018 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bibox added in v0.2.0

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

Bibox the exchange struct of Bibox.com

func (*Bibox) AutoSleep added in v0.2.0

func (e *Bibox) AutoSleep()

AutoSleep auto sleep to achieve the limit calls amount per second of this exchange

func (*Bibox) CancelOrder added in v0.2.0

func (e *Bibox) CancelOrder(order Order) bool

CancelOrder cancel an order

func (*Bibox) ExchangeRate added in v0.2.0

func (e *Bibox) ExchangeRate(count string, stockType string) string

func (*Bibox) GetAccount added in v0.2.0

func (e *Bibox) GetAccount() interface{}

GetAccount get the account detail of this exchange

func (*Bibox) GetMinAmount added in v0.2.0

func (e *Bibox) GetMinAmount(stock string) float64

GetMinAmount get the min trade amonut of this exchange

func (*Bibox) GetName added in v0.2.0

func (e *Bibox) GetName() string

GetName get the name of this exchange

func (*Bibox) GetOrder added in v0.2.0

func (e *Bibox) GetOrder(stockType, id string) interface{}

GetOrder get details of an order

func (*Bibox) GetOrders added in v0.2.0

func (e *Bibox) GetOrders(stockType string) interface{}

GetOrders get all unfilled orders

func (*Bibox) GetRecords added in v0.2.0

func (e *Bibox) GetRecords(stockType, period string, sizes ...interface{}) interface{}

GetRecords get candlestick data

func (*Bibox) GetTicker added in v0.2.0

func (e *Bibox) GetTicker(stockType string, sizes ...interface{}) interface{}

GetTicker get market ticker & depth

func (*Bibox) GetTrades added in v0.2.0

func (e *Bibox) GetTrades(stockType string) interface{}

GetTrades get all filled orders recently

func (*Bibox) GetType added in v0.2.0

func (e *Bibox) GetType() string

GetType get the type of this exchange

func (*Bibox) Log added in v0.2.0

func (e *Bibox) Log(msgs ...interface{})

Log print something to console

func (*Bibox) SetLimit added in v0.2.0

func (e *Bibox) SetLimit(times interface{}) float64

SetLimit set the limit calls amount per second of this exchange

func (*Bibox) Trade added in v0.2.0

func (e *Bibox) Trade(tradeType string, stockType string, _price, _amount interface{}, msgs ...interface{}) interface{}

Trade place an order

type Btcc

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

Btcc the exchange struct of btcc.com

func (*Btcc) AutoSleep

func (e *Btcc) AutoSleep()

AutoSleep auto sleep to achieve the limit calls amount per second of this exchange

func (*Btcc) CancelOrder

func (e *Btcc) CancelOrder(order Order) bool

CancelOrder cancel an order

func (*Btcc) ExchangeRate added in v0.2.0

func (e *Btcc) ExchangeRate(count string, stockType string) string

func (*Btcc) GetAccount

func (e *Btcc) GetAccount() interface{}

GetAccount get the account detail of this exchange

func (*Btcc) GetMinAmount

func (e *Btcc) GetMinAmount(stock string) float64

GetMinAmount get the min trade amonut of this exchange

func (*Btcc) GetName

func (e *Btcc) GetName() string

GetName get the name of this exchange

func (*Btcc) GetOrder

func (e *Btcc) GetOrder(stockType, id string) interface{}

GetOrder get details of an order

func (*Btcc) GetOrders

func (e *Btcc) GetOrders(stockType string) interface{}

GetOrders get all unfilled orders

func (*Btcc) GetRecords

func (e *Btcc) GetRecords(stockType, period string, sizes ...interface{}) interface{}

GetRecords get candlestick data

func (*Btcc) GetTicker

func (e *Btcc) GetTicker(stockType string, sizes ...interface{}) interface{}

GetTicker get market ticker & depth

func (*Btcc) GetTrades

func (e *Btcc) GetTrades(stockType string) interface{}

GetTrades get all filled orders recently

func (*Btcc) GetType

func (e *Btcc) GetType() string

GetType get the type of this exchange

func (*Btcc) Log

func (e *Btcc) Log(msgs ...interface{})

Log print something to console

func (*Btcc) SetLimit

func (e *Btcc) SetLimit(times interface{}) float64

SetLimit set the limit calls amount per second of this exchange

func (*Btcc) Trade

func (e *Btcc) Trade(tradeType string, stockType string, _price, _amount interface{}, msgs ...interface{}) interface{}

Trade place an order

type Chbtc

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

Chbtc the exchange struct of chbtc.com

func (*Chbtc) AutoSleep

func (e *Chbtc) AutoSleep()

AutoSleep auto sleep to achieve the limit calls amount per second of this exchange

func (*Chbtc) CancelOrder

func (e *Chbtc) CancelOrder(order Order) bool

CancelOrder cancel an order

func (*Chbtc) ExchangeRate added in v0.2.0

func (e *Chbtc) ExchangeRate(count string, stockType string) string

func (*Chbtc) GetAccount

func (e *Chbtc) GetAccount() interface{}

GetAccount get the account detail of this exchange

func (*Chbtc) GetMinAmount

func (e *Chbtc) GetMinAmount(stock string) float64

GetMinAmount get the min trade amonut of this exchange

func (*Chbtc) GetName

func (e *Chbtc) GetName() string

GetName get the name of this exchange

func (*Chbtc) GetOrder

func (e *Chbtc) GetOrder(stockType, id string) interface{}

GetOrder get details of an order

func (*Chbtc) GetOrders

func (e *Chbtc) GetOrders(stockType string) interface{}

GetOrders get all unfilled orders

func (*Chbtc) GetRecords

func (e *Chbtc) GetRecords(stockType, period string, sizes ...interface{}) interface{}

GetRecords get candlestick data

func (*Chbtc) GetTicker

func (e *Chbtc) GetTicker(stockType string, sizes ...interface{}) interface{}

GetTicker get market ticker & depth

func (*Chbtc) GetTrades

func (e *Chbtc) GetTrades(stockType string) interface{}

GetTrades get all filled orders recently

func (*Chbtc) GetType

func (e *Chbtc) GetType() string

GetType get the type of this exchange

func (*Chbtc) Log

func (e *Chbtc) Log(msgs ...interface{})

Log print something to console

func (*Chbtc) SetLimit

func (e *Chbtc) SetLimit(times interface{}) float64

SetLimit set the limit calls amount per second of this exchange

func (*Chbtc) Trade

func (e *Chbtc) Trade(tradeType string, stockType string, _price, _amount interface{}, msgs ...interface{}) interface{}

Trade place an order

type Exchange

type Exchange interface {
	Log(...interface{})
	ExchangeRate(count string, stockType string) string
	GetType() string
	GetName() string
	SetLimit(times interface{}) float64
	AutoSleep()
	GetMinAmount(stock string) float64
	GetAccount() interface{}
	Trade(tradeType string, stockType string, price, amount interface{}, msgs ...interface{}) interface{}
	GetOrder(stockType, id string) interface{}
	GetOrders(stockType string) interface{}
	GetTrades(stockType string) interface{}
	CancelOrder(order Order) bool
	GetTicker(stockType string, sizes ...interface{}) interface{}
	GetRecords(stockType, period string, sizes ...interface{}) interface{}
}

Exchange interface

func NewBibox added in v0.2.0

func NewBibox(opt Option) Exchange

NewBibox create an exchange struct of Bibox.com

func NewBtcc

func NewBtcc(opt Option) Exchange

NewBtcc create an exchange struct of okcoin.cn

func NewChbtc

func NewChbtc(opt Option) Exchange

NewChbtc create an exchange struct of chbtc.com

func NewHuobiPro added in v0.2.0

func NewHuobiPro(opt Option) Exchange

NewHuobiPro create an exchange struct of huobipro.com

func NewOKCoinCn

func NewOKCoinCn(opt Option) Exchange

NewOKCoinCn create an exchange struct of okcoin.cn

func NewOKCoinFuture

func NewOKCoinFuture(opt Option) Exchange

NewOKCoinFuture create an exchange struct of okcoin.cn

func NewOandaV20

func NewOandaV20(opt Option) Exchange

NewOandaV20 create an exchange struct of okcoin.cn

func NewPoloniex

func NewPoloniex(opt Option) Exchange

NewPoloniex create an exchange struct of poloniex

type HuobiPro added in v0.2.0

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

HuobiPro the exchange struct of huobipro.com

func (*HuobiPro) AutoSleep added in v0.2.0

func (e *HuobiPro) AutoSleep()

AutoSleep auto sleep to achieve the limit calls amount per second of this exchange

func (*HuobiPro) CancelOrder added in v0.2.0

func (e *HuobiPro) CancelOrder(order Order) bool

CancelOrder cancel an order

func (*HuobiPro) ExchangeRate added in v0.2.0

func (e *HuobiPro) ExchangeRate(count string, stockType string) string

func (*HuobiPro) GetAccount added in v0.2.0

func (e *HuobiPro) GetAccount() interface{}

GetAccount get the account detail of this exchange

func (*HuobiPro) GetMinAmount added in v0.2.0

func (e *HuobiPro) GetMinAmount(stock string) float64

GetMinAmount get the min trade amonut of this exchange

func (*HuobiPro) GetName added in v0.2.0

func (e *HuobiPro) GetName() string

GetName get the name of this exchange

func (*HuobiPro) GetOrder added in v0.2.0

func (e *HuobiPro) GetOrder(stockType, id string) interface{}

GetOrder get details of an order

func (*HuobiPro) GetOrders added in v0.2.0

func (e *HuobiPro) GetOrders(stockType string) interface{}

GetOrders get all unfilled orders

func (*HuobiPro) GetRecords added in v0.2.0

func (e *HuobiPro) GetRecords(stockType, period string, sizes ...interface{}) interface{}

GetRecords get candlestick data

func (*HuobiPro) GetTicker added in v0.2.0

func (e *HuobiPro) GetTicker(stockType string, sizes ...interface{}) interface{}

GetTicker get market ticker & depth

func (*HuobiPro) GetTrades added in v0.2.0

func (e *HuobiPro) GetTrades(stockType string) interface{}

GetTrades get all filled orders recently

func (*HuobiPro) GetType added in v0.2.0

func (e *HuobiPro) GetType() string

GetType get the type of this exchange

func (*HuobiPro) Log added in v0.2.0

func (e *HuobiPro) Log(msgs ...interface{})

Log print something to console

func (*HuobiPro) SetLimit added in v0.2.0

func (e *HuobiPro) SetLimit(times interface{}) float64

SetLimit set the limit calls amount per second of this exchange

func (*HuobiPro) Trade added in v0.2.0

func (e *HuobiPro) Trade(tradeType string, stockType string, _price, _amount interface{}, msgs ...interface{}) interface{}

Trade place an order

type OKCoinCn

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

OKCoinCn the exchange struct of okcoin.cn

func (*OKCoinCn) AutoSleep

func (e *OKCoinCn) AutoSleep()

AutoSleep auto sleep to achieve the limit calls amount per second of this exchange

func (*OKCoinCn) CancelOrder

func (e *OKCoinCn) CancelOrder(order Order) bool

CancelOrder cancel an order

func (*OKCoinCn) ExchangeRate added in v0.2.0

func (e *OKCoinCn) ExchangeRate(count string, stockType string) string

func (*OKCoinCn) GetAccount

func (e *OKCoinCn) GetAccount() interface{}

GetAccount get the account detail of this exchange

func (*OKCoinCn) GetMinAmount

func (e *OKCoinCn) GetMinAmount(stock string) float64

GetMinAmount get the min trade amonut of this exchange

func (*OKCoinCn) GetName

func (e *OKCoinCn) GetName() string

GetName get the name of this exchange

func (*OKCoinCn) GetOrder

func (e *OKCoinCn) GetOrder(stockType, id string) interface{}

GetOrder get details of an order

func (*OKCoinCn) GetOrders

func (e *OKCoinCn) GetOrders(stockType string) interface{}

GetOrders get all unfilled orders

func (*OKCoinCn) GetRecords

func (e *OKCoinCn) GetRecords(stockType, period string, sizes ...interface{}) interface{}

GetRecords get candlestick data

func (*OKCoinCn) GetTicker

func (e *OKCoinCn) GetTicker(stockType string, sizes ...interface{}) interface{}

GetTicker get market ticker & depth

func (*OKCoinCn) GetTrades

func (e *OKCoinCn) GetTrades(stockType string) interface{}

GetTrades get all filled orders recently

func (*OKCoinCn) GetType

func (e *OKCoinCn) GetType() string

GetType get the type of this exchange

func (*OKCoinCn) Log

func (e *OKCoinCn) Log(msgs ...interface{})

Log print something to console

func (*OKCoinCn) SetLimit

func (e *OKCoinCn) SetLimit(times interface{}) float64

SetLimit set the limit calls amount per second of this exchange

func (*OKCoinCn) Trade

func (e *OKCoinCn) Trade(tradeType string, stockType string, _price, _amount interface{}, msgs ...interface{}) interface{}

Trade place an order

type OKCoinFuture

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

OKCoinFuture the exchange struct of okcoin.com future

func (*OKCoinFuture) AutoSleep

func (e *OKCoinFuture) AutoSleep()

AutoSleep auto sleep to achieve the limit calls amount per second of this exchange

func (*OKCoinFuture) CancelOrder

func (e *OKCoinFuture) CancelOrder(order Order) bool

CancelOrder cancel an order

func (*OKCoinFuture) ExchangeRate added in v0.2.0

func (e *OKCoinFuture) ExchangeRate(count string, stockType string) string

func (*OKCoinFuture) GetAccount

func (e *OKCoinFuture) GetAccount() interface{}

GetAccount get the account detail of this exchange

func (*OKCoinFuture) GetMinAmount

func (e *OKCoinFuture) GetMinAmount(stock string) float64

GetMinAmount get the min trade amonut of this exchange

func (*OKCoinFuture) GetName

func (e *OKCoinFuture) GetName() string

GetName get the name of this exchange

func (*OKCoinFuture) GetOrder

func (e *OKCoinFuture) GetOrder(stockType, id string) interface{}

GetOrder get details of an order

func (*OKCoinFuture) GetOrders

func (e *OKCoinFuture) GetOrders(stockType string) interface{}

GetOrders get all unfilled orders

func (*OKCoinFuture) GetPositions

func (e *OKCoinFuture) GetPositions(stockType string) interface{}

GetPositions get the positions detail of this exchange

func (*OKCoinFuture) GetRecords

func (e *OKCoinFuture) GetRecords(stockType, period string, sizes ...interface{}) interface{}

GetRecords get candlestick data

func (*OKCoinFuture) GetTicker

func (e *OKCoinFuture) GetTicker(stockType string, sizes ...interface{}) interface{}

GetTicker get market ticker & depth

func (*OKCoinFuture) GetTrades

func (e *OKCoinFuture) GetTrades(stockType string) interface{}

GetTrades get all filled orders recently

func (*OKCoinFuture) GetType

func (e *OKCoinFuture) GetType() string

GetType get the type of this exchange

func (*OKCoinFuture) Log

func (e *OKCoinFuture) Log(msgs ...interface{})

Log print something to console

func (*OKCoinFuture) SetLimit

func (e *OKCoinFuture) SetLimit(times interface{}) float64

SetLimit set the limit calls amount per second of this exchange

func (*OKCoinFuture) Trade

func (e *OKCoinFuture) Trade(tradeType string, stockType string, _price, _amount interface{}, msgs ...interface{}) interface{}

Trade place an order

type OandaV20

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

OandaV20 the exchange struct of oanda.com v20

func (*OandaV20) AutoSleep

func (e *OandaV20) AutoSleep()

AutoSleep auto sleep to achieve the limit calls amount per second of this exchange

func (*OandaV20) CancelOrder

func (e *OandaV20) CancelOrder(order Order) bool

CancelOrder cancel an order

func (*OandaV20) ExchangeRate added in v0.2.0

func (e *OandaV20) ExchangeRate(count string, stockType string) string

func (*OandaV20) GetAccount

func (e *OandaV20) GetAccount() interface{}

GetAccount get the account detail of this exchange

func (*OandaV20) GetMinAmount

func (e *OandaV20) GetMinAmount(stock string) float64

GetMinAmount get the min trade amonut of this exchange

func (*OandaV20) GetName

func (e *OandaV20) GetName() string

GetName get the name of this exchange

func (*OandaV20) GetOrder

func (e *OandaV20) GetOrder(stockType, id string) interface{}

GetOrder get details of an order

func (*OandaV20) GetOrders

func (e *OandaV20) GetOrders(stockType string) interface{}

GetOrders get all unfilled orders

func (*OandaV20) GetPositions

func (e *OandaV20) GetPositions(stockType string) interface{}

GetPositions get the positions detail of this exchange

func (*OandaV20) GetRecords

func (e *OandaV20) GetRecords(stockType, period string, sizes ...interface{}) interface{}

GetRecords get candlestick data

func (*OandaV20) GetTicker

func (e *OandaV20) GetTicker(stockType string, sizes ...interface{}) interface{}

GetTicker get market ticker & depth

func (*OandaV20) GetTrades

func (e *OandaV20) GetTrades(stockType string) interface{}

GetTrades get all filled orders recently

func (*OandaV20) GetType

func (e *OandaV20) GetType() string

GetType get the type of this exchange

func (*OandaV20) Log

func (e *OandaV20) Log(msgs ...interface{})

Log print something to console

func (*OandaV20) SetLimit

func (e *OandaV20) SetLimit(times interface{}) float64

SetLimit set the limit calls amount per second of this exchange

func (*OandaV20) Trade

func (e *OandaV20) Trade(tradeType string, stockType string, _price, _amount interface{}, msgs ...interface{}) interface{}

Trade place an order

type Option

type Option struct {
	TraderID  int64
	Type      string
	Name      string
	AccessKey string
	SecretKey string
}

Option is an exchange option

type Order

type Order struct {
	ID         string
	Price      float64
	Amount     float64
	DealAmount float64
	Fee        float64
	TradeType  string
	StockType  string
}

Order struct

type OrderBook

type OrderBook struct {
	Price  float64
	Amount float64
}

OrderBook struct

type Poloniex

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

Poloniex the exchange struct of poloniex

func (*Poloniex) AutoSleep

func (e *Poloniex) AutoSleep()

AutoSleep auto sleep to achieve the limit calls amount per second of this exchange

func (*Poloniex) CancelOrder

func (e *Poloniex) CancelOrder(order Order) bool

CancelOrder cancel an order

func (*Poloniex) ExchangeRate added in v0.2.0

func (e *Poloniex) ExchangeRate(count string, stockType string) string

func (*Poloniex) GetAccount

func (e *Poloniex) GetAccount() interface{}

GetAccount get the account detail of this exchange

func (*Poloniex) GetMinAmount

func (e *Poloniex) GetMinAmount(stock string) float64

GetMinAmount get the min trade amonut of this exchange

func (*Poloniex) GetName

func (e *Poloniex) GetName() string

GetName get the name of this exchange

func (*Poloniex) GetOrder

func (e *Poloniex) GetOrder(stockType, id string) interface{}

GetOrder get details of an order

func (*Poloniex) GetOrders

func (e *Poloniex) GetOrders(stockType string) interface{}

GetOrders get all unfilled orders

func (*Poloniex) GetRecords

func (e *Poloniex) GetRecords(stockType, period string, sizes ...interface{}) interface{}

GetRecords get candlestick data

func (*Poloniex) GetTicker

func (e *Poloniex) GetTicker(stockType string, sizes ...interface{}) interface{}

GetTicker get market ticker & depth

func (*Poloniex) GetTrades

func (e *Poloniex) GetTrades(stockType string) interface{}

GetTrades get all filled orders recently

func (*Poloniex) GetType

func (e *Poloniex) GetType() string

GetType get the type of this exchange

func (*Poloniex) Log

func (e *Poloniex) Log(msgs ...interface{})

Log print something to console

func (*Poloniex) SetLimit

func (e *Poloniex) SetLimit(times interface{}) float64

SetLimit set the limit calls amount per second of this exchange

func (*Poloniex) Trade

func (e *Poloniex) Trade(tradeType string, stockType string, _price, _amount interface{}, msgs ...interface{}) interface{}

Trade place an order

type Position

type Position struct {
	Price         float64
	Leverage      int
	Amount        float64
	ConfirmAmount float64
	FrozenAmount  float64
	Profit        float64
	ContractType  string
	TradeType     string
	StockType     string
}

Position struct

type Record

type Record struct {
	Time   int64
	Open   float64
	High   float64
	Low    float64
	Close  float64
	Volume float64
}

Record struct

type Ticker

type Ticker struct {
	Bids []OrderBook
	Buy  float64
	Mid  float64
	Sell float64
	Asks []OrderBook
}

Ticker struct

Jump to

Keyboard shortcuts

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