api

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2016 License: MIT Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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) 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) 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{})
	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 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 NewHuobi

func NewHuobi(opt Option) Exchange

NewHuobi create an exchange struct of huobi.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 Huobi

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

Huobi the exchange struct of huobi.com

func (*Huobi) AutoSleep

func (e *Huobi) AutoSleep()

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

func (*Huobi) CancelOrder

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

CancelOrder cancel an order

func (*Huobi) GetAccount

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

GetAccount get the account detail of this exchange

func (*Huobi) GetMinAmount

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

GetMinAmount get the min trade amonut of this exchange

func (*Huobi) GetName

func (e *Huobi) GetName() string

GetName get the name of this exchange

func (*Huobi) GetOrder

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

GetOrder get details of an order

func (*Huobi) GetOrders

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

GetOrders get all unfilled orders

func (*Huobi) GetRecords

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

GetRecords get candlestick data

func (*Huobi) GetTicker

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

GetTicker get market ticker & depth

func (*Huobi) GetTrades

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

GetTrades get all filled orders recently

func (*Huobi) GetType

func (e *Huobi) GetType() string

GetType get the type of this exchange

func (*Huobi) Log

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

Log print something to console

func (*Huobi) SetLimit

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

SetLimit set the limit calls amount per second of this exchange

func (*Huobi) Trade

func (e *Huobi) 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) 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) 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) 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) 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