Documentation ¶
Index ¶
- type BigOne
- func (e *BigOne) AutoSleep()
- func (e *BigOne) CancelOrder(order Order) bool
- func (e *BigOne) GetAccount() interface{}
- func (e *BigOne) GetMinAmount(stock string) float64
- func (e *BigOne) GetName() string
- func (e *BigOne) GetOrder(stockType, id string) interface{}
- func (e *BigOne) GetOrders(stockType string) interface{}
- func (e *BigOne) GetRecords(stockType, period string, sizes ...interface{}) interface{}
- func (e *BigOne) GetTicker(stockType string, sizes ...interface{}) interface{}
- func (e *BigOne) GetTrades(stockType string) interface{}
- func (e *BigOne) GetType() string
- func (e *BigOne) Log(msgs ...interface{})
- func (e *BigOne) SetLimit(times interface{}) float64
- func (e *BigOne) Trade(tradeType string, stockType string, _price, _amount interface{}, ...) interface{}
- type Binance
- func (e *Binance) AutoSleep()
- func (e *Binance) CancelOrder(order Order) bool
- func (e *Binance) GetAccount() interface{}
- func (e *Binance) GetMinAmount(stock string) float64
- func (e *Binance) GetName() string
- func (e *Binance) GetOrder(stockType, id string) interface{}
- func (e *Binance) GetOrders(stockType string) interface{}
- func (e *Binance) GetRecords(stockType, period string, sizes ...interface{}) interface{}
- func (e *Binance) GetTicker(stockType string, sizes ...interface{}) interface{}
- func (e *Binance) GetTrades(stockType string) interface{}
- func (e *Binance) GetType() string
- func (e *Binance) Log(msgs ...interface{})
- func (e *Binance) SetLimit(times interface{}) float64
- func (e *Binance) Trade(tradeType string, stockType string, _price, _amount interface{}, ...) interface{}
- type Exchange
- type GateIo
- func (e *GateIo) AutoSleep()
- func (e *GateIo) CancelOrder(order Order) bool
- func (e *GateIo) GetAccount() interface{}
- func (e *GateIo) GetMinAmount(stock string) float64
- func (e *GateIo) GetName() string
- func (e *GateIo) GetOrder(stockType, id string) interface{}
- func (e *GateIo) GetOrders(stockType string) interface{}
- func (e *GateIo) GetRecords(stockType, period string, sizes ...interface{}) interface{}
- func (e *GateIo) GetTicker(stockType string, sizes ...interface{}) interface{}
- func (e *GateIo) GetTrades(stockType string) interface{}
- func (e *GateIo) GetType() string
- func (e *GateIo) Log(msgs ...interface{})
- func (e *GateIo) SetLimit(times interface{}) float64
- func (e *GateIo) Trade(tradeType string, stockType string, _price, _amount interface{}, ...) interface{}
- type Huobi
- func (e *Huobi) AutoSleep()
- func (e *Huobi) CancelOrder(order Order) bool
- func (e *Huobi) GetAccount() interface{}
- func (e *Huobi) GetMinAmount(stock string) float64
- func (e *Huobi) GetName() string
- func (e *Huobi) GetOrder(stockType, id string) interface{}
- func (e *Huobi) GetOrders(stockType string) interface{}
- func (e *Huobi) GetRecords(stockType, period string, sizes ...interface{}) interface{}
- func (e *Huobi) GetTicker(stockType string, sizes ...interface{}) interface{}
- func (e *Huobi) GetTrades(stockType string) interface{}
- func (e *Huobi) GetType() string
- func (e *Huobi) Log(msgs ...interface{})
- func (e *Huobi) SetLimit(times interface{}) float64
- func (e *Huobi) Trade(tradeType string, stockType string, _price, _amount interface{}, ...) interface{}
- type OKEX
- func (e *OKEX) AutoSleep()
- func (e *OKEX) CancelOrder(order Order) bool
- func (e *OKEX) GetAccount() interface{}
- func (e *OKEX) GetMinAmount(stock string) float64
- func (e *OKEX) GetName() string
- func (e *OKEX) GetOrder(stockType, id string) interface{}
- func (e *OKEX) GetOrders(stockType string) interface{}
- func (e *OKEX) GetRecords(stockType, period string, sizes ...interface{}) interface{}
- func (e *OKEX) GetTicker(stockType string, sizes ...interface{}) interface{}
- func (e *OKEX) GetTrades(stockType string) interface{}
- func (e *OKEX) GetType() string
- func (e *OKEX) Log(msgs ...interface{})
- func (e *OKEX) SetLimit(times interface{}) float64
- func (e *OKEX) Trade(tradeType string, stockType string, _price, _amount interface{}, ...) interface{}
- type OkexFuture
- func (e *OkexFuture) AutoSleep()
- func (e *OkexFuture) CancelOrder(order Order) bool
- func (e *OkexFuture) GetAccount() interface{}
- func (e *OkexFuture) GetMinAmount(stock string) float64
- func (e *OkexFuture) GetName() string
- func (e *OkexFuture) GetOrder(stockType, id string) interface{}
- func (e *OkexFuture) GetOrders(stockType string) interface{}
- func (e *OkexFuture) GetPositions(stockType string) interface{}
- func (e *OkexFuture) GetRecords(stockType, period string, sizes ...interface{}) interface{}
- func (e *OkexFuture) GetTicker(stockType string, sizes ...interface{}) interface{}
- func (e *OkexFuture) GetTrades(stockType string) interface{}
- func (e *OkexFuture) GetType() string
- func (e *OkexFuture) Log(msgs ...interface{})
- func (e *OkexFuture) SetLimit(times interface{}) float64
- func (e *OkexFuture) Trade(tradeType string, stockType string, _price, _amount interface{}, ...) interface{}
- type Option
- type Order
- type OrderBook
- type Poloniex
- func (e *Poloniex) AutoSleep()
- func (e *Poloniex) CancelOrder(order Order) bool
- func (e *Poloniex) GetAccount() interface{}
- func (e *Poloniex) GetMinAmount(stock string) float64
- func (e *Poloniex) GetName() string
- func (e *Poloniex) GetOrder(stockType, id string) interface{}
- func (e *Poloniex) GetOrders(stockType string) interface{}
- func (e *Poloniex) GetRecords(stockType, period string, sizes ...interface{}) interface{}
- func (e *Poloniex) GetTicker(stockType string, sizes ...interface{}) interface{}
- func (e *Poloniex) GetTrades(stockType string) interface{}
- func (e *Poloniex) GetType() string
- func (e *Poloniex) Log(msgs ...interface{})
- func (e *Poloniex) SetLimit(times interface{}) float64
- func (e *Poloniex) Trade(tradeType string, stockType string, _price, _amount interface{}, ...) interface{}
- type Position
- type Record
- type Ticker
- type Zb
- func (e *Zb) AutoSleep()
- func (e *Zb) CancelOrder(order Order) bool
- func (e *Zb) GetAccount() interface{}
- func (e *Zb) GetMinAmount(stock string) float64
- func (e *Zb) GetName() string
- func (e *Zb) GetOrder(stockType, id string) interface{}
- func (e *Zb) GetOrders(stockType string) interface{}
- func (e *Zb) GetRecords(stockType, period string, sizes ...interface{}) interface{}
- func (e *Zb) GetTicker(stockType string, sizes ...interface{}) interface{}
- func (e *Zb) GetTrades(stockType string) interface{}
- func (e *Zb) GetType() string
- func (e *Zb) Log(msgs ...interface{})
- func (e *Zb) SetLimit(times interface{}) float64
- func (e *Zb) Trade(tradeType string, stockType string, _price, _amount interface{}, ...) interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BigOne ¶
type BigOne struct {
// contains filtered or unexported fields
}
BigOne the exchange struct of big.one
func (*BigOne) AutoSleep ¶
func (e *BigOne) AutoSleep()
AutoSleep auto sleep to achieve the limit calls amount per second of this exchange
func (*BigOne) CancelOrder ¶
CancelOrder cancel an order
func (*BigOne) GetAccount ¶
func (e *BigOne) GetAccount() interface{}
GetAccount get the account detail of this exchange
func (*BigOne) GetMinAmount ¶
GetMinAmount get the min trade amonut of this exchange
func (*BigOne) GetRecords ¶
GetRecords get candlestick data
type Binance ¶
type Binance struct {
// contains filtered or unexported fields
}
Binance the exchange struct of binance.com
func (*Binance) AutoSleep ¶
func (e *Binance) AutoSleep()
AutoSleep auto sleep to achieve the limit calls amount per second of this exchange
func (*Binance) CancelOrder ¶
CancelOrder cancel an order
func (*Binance) GetAccount ¶
func (e *Binance) GetAccount() interface{}
GetAccount get the account detail of this exchange
func (*Binance) GetMinAmount ¶
GetMinAmount get the min trade amonut of this exchange
func (*Binance) GetRecords ¶
GetRecords get candlestick data
type Exchange ¶
type Exchange interface { Log(...interface{}) //向管理台发送这个交易所的打印信息 GetType() string //获取交易所类型,是火币还是OKEY等。。。 GetName() string //获取交易所名称,自定义的 SetLimit(times interface{}) float64 //设置交易所的API访问频率,和 E.AutoSleep() 配合使用 AutoSleep() //自动休眠以满足设置的交易所的API访问频率 GetMinAmount(stock string) float64 //获取交易所的最小交易数量 GetAccount() interface{} //获取交易所的账户资金信息 Trade(tradeType string, stockType string, price, amount interface{}, msgs ...interface{}) interface{} //如果 Price <= 0 自动设置为市价单,数量参数也有所不同,如果成功返回订单的 ID,如果失败返回 false 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{} //返回交易所的最新K线数据列表 }
Exchange interface
func NewBinance ¶
NewBinance create an exchange struct of Binance.com
func NewOkexFuture ¶
NewOkexFuture create an exchange struct of okex.com
func NewPoloniex ¶
NewPoloniex create an exchange struct of poloniex
type GateIo ¶
type GateIo struct {
// contains filtered or unexported fields
}
GateIo the exchange struct of gateio.io
func (*GateIo) AutoSleep ¶
func (e *GateIo) AutoSleep()
AutoSleep auto sleep to achieve the limit calls amount per second of this exchange
func (*GateIo) CancelOrder ¶
CancelOrder cancel an order
func (*GateIo) GetAccount ¶
func (e *GateIo) GetAccount() interface{}
GetAccount get the account detail of this exchange
func (*GateIo) GetMinAmount ¶
GetMinAmount get the min trade amonut of this exchange
func (*GateIo) GetRecords ¶
GetRecords get candlestick data
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 ¶
CancelOrder cancel an order
func (*Huobi) GetAccount ¶
func (e *Huobi) GetAccount() interface{}
GetAccount get the account detail of this exchange
func (*Huobi) GetMinAmount ¶
GetMinAmount get the min trade amonut of this exchange
func (*Huobi) GetRecords ¶
GetRecords get candlestick data
type OKEX ¶
type OKEX struct {
// contains filtered or unexported fields
}
OKEX the exchange struct of okex.com
func (*OKEX) AutoSleep ¶
func (e *OKEX) AutoSleep()
AutoSleep auto sleep to achieve the limit calls amount per second of this exchange
func (*OKEX) GetAccount ¶
func (e *OKEX) GetAccount() interface{}
GetAccount get the account detail of this exchange
func (*OKEX) GetMinAmount ¶
GetMinAmount get the min trade amonut of this exchange
func (*OKEX) GetRecords ¶
GetRecords get candlestick data
type OkexFuture ¶
type OkexFuture struct {
// contains filtered or unexported fields
}
OkexFuture the exchange struct of okex.com future
func (*OkexFuture) AutoSleep ¶
func (e *OkexFuture) AutoSleep()
AutoSleep auto sleep to achieve the limit calls amount per second of this exchange
func (*OkexFuture) CancelOrder ¶
func (e *OkexFuture) CancelOrder(order Order) bool
CancelOrder cancel an order
func (*OkexFuture) GetAccount ¶
func (e *OkexFuture) GetAccount() interface{}
GetAccount get the account detail of this exchange
func (*OkexFuture) GetMinAmount ¶
func (e *OkexFuture) GetMinAmount(stock string) float64
GetMinAmount get the min trade amonut of this exchange
func (*OkexFuture) GetName ¶
func (e *OkexFuture) GetName() string
GetName get the name of this exchange
func (*OkexFuture) GetOrder ¶
func (e *OkexFuture) GetOrder(stockType, id string) interface{}
GetOrder get details of an order
func (*OkexFuture) GetOrders ¶
func (e *OkexFuture) GetOrders(stockType string) interface{}
GetOrders get all unfilled orders
func (*OkexFuture) GetPositions ¶
func (e *OkexFuture) GetPositions(stockType string) interface{}
GetPositions get the positions detail of this exchange
func (*OkexFuture) GetRecords ¶
func (e *OkexFuture) GetRecords(stockType, period string, sizes ...interface{}) interface{}
GetRecords get candlestick data
func (*OkexFuture) GetTicker ¶
func (e *OkexFuture) GetTicker(stockType string, sizes ...interface{}) interface{}
GetTicker get market ticker & depth
func (*OkexFuture) GetTrades ¶
func (e *OkexFuture) GetTrades(stockType string) interface{}
GetTrades get all filled orders recently
func (*OkexFuture) GetType ¶
func (e *OkexFuture) GetType() string
GetType get the type of this exchange
func (*OkexFuture) Log ¶
func (e *OkexFuture) Log(msgs ...interface{})
Log print something to console
func (*OkexFuture) SetLimit ¶
func (e *OkexFuture) SetLimit(times interface{}) float64
SetLimit set the limit calls amount per second of this exchange
func (*OkexFuture) Trade ¶
func (e *OkexFuture) Trade(tradeType string, stockType string, _price, _amount interface{}, msgs ...interface{}) interface{}
Trade place an order
type Order ¶
type Order struct { ID string //订单ID Price float64 //价格 Amount float64 //总量 DealAmount float64 //成交量 Fee float64 //这个订单的交易费 TradeType string //交易类型 StockType string //货币类型 }
Order 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 ¶
CancelOrder cancel an order
func (*Poloniex) GetAccount ¶
func (e *Poloniex) GetAccount() interface{}
GetAccount get the account detail of this exchange
func (*Poloniex) GetMinAmount ¶
GetMinAmount get the min trade amonut of this exchange
func (*Poloniex) GetRecords ¶
GetRecords get candlestick data
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 //unix时间戳 Open float64 //开盘价 High float64 //最高价 Low float64 //最低价 Close float64 //收盘价 Volume float64 //交易量 }
Record struct
type Ticker ¶
type Ticker struct { Bids []OrderBook //买单市场深度列表 Buy float64 //买一价, Bids[0].Price Mid float64 //(Buy + Sell) / 2 Sell float64 //卖一价, Asks[0].Price Asks []OrderBook //卖单市场深度列表 }
Ticker struct
type Zb ¶
type Zb struct {
// contains filtered or unexported fields
}
Zb the exchange struct of zb.com
func (*Zb) AutoSleep ¶
func (e *Zb) AutoSleep()
AutoSleep auto sleep to achieve the limit calls amount per second of this exchange
func (*Zb) GetAccount ¶
func (e *Zb) GetAccount() interface{}
GetAccount get the account detail of this exchange
func (*Zb) GetMinAmount ¶
GetMinAmount get the min trade amonut of this exchange
func (*Zb) GetRecords ¶
GetRecords get candlestick data