Documentation ¶
Index ¶
- type Binance
- func (e *Binance) AutoSleep()
- func (o *Binance) CancelOrder(orderId string, currency goex.CurrencyPair) (bool, error)
- func (o *Binance) GetAccount() (*goex.Account, error)
- func (o *Binance) GetDepth(size int, currency goex.CurrencyPair) (*goex.Depth, error)
- func (o *Binance) GetExchangeName() string
- func (e *Binance) GetMinAmount(stock string) float64
- func (e *Binance) GetName() string
- func (o *Binance) GetOneOrder(orderId string, currency goex.CurrencyPair) (*goex.Order, error)
- func (o *Binance) GetOrderHistorys(currency goex.CurrencyPair, opt ...goex.OptionalParameter) ([]goex.Order, error)
- func (o *Binance) GetTicker(currency goex.CurrencyPair) (*goex.Ticker, error)
- func (o *Binance) GetTrades(currencyPair goex.CurrencyPair, since int64) ([]goex.Trade, error)
- func (e *Binance) GetType() string
- func (o *Binance) GetUnfinishOrders(currency goex.CurrencyPair) ([]goex.Order, error)
- func (o *Binance) LimitBuy(amount, price string, currency goex.CurrencyPair, ...) (*goex.Order, error)
- func (o *Binance) LimitSell(amount, price string, currency goex.CurrencyPair, ...) (*goex.Order, error)
- func (e *Binance) Log(msgs ...interface{})
- func (o *Binance) MarketBuy(amount, price string, currency goex.CurrencyPair) (*goex.Order, error)
- func (o *Binance) MarketSell(amount, price string, currency goex.CurrencyPair) (*goex.Order, error)
- func (e *Binance) SetLimit(times interface{}) float64
- type Exchange
- type OKEX
- func (e *OKEX) AutoSleep()
- func (o *OKEX) CancelOrder(orderId string, currency goex.CurrencyPair) (bool, error)
- func (o *OKEX) GetAccount() (*goex.Account, error)
- func (o *OKEX) GetDepth(size int, currency goex.CurrencyPair) (*goex.Depth, error)
- func (o *OKEX) GetExchangeName() string
- func (e *OKEX) GetInstIdTicker(instId string) interface{}
- func (e *OKEX) GetKline(instId string, period int, options ...utils.OptionalParameter) ([]goex.Kline, error)
- func (e *OKEX) GetKlineFuture(contractType string, currency goex.CurrencyPair, period goex.KlinePeriod, ...) ([]goex.Kline, error)
- func (o *OKEX) GetKlineRecords(instId string, period goex.KlinePeriod, size int, ...) ([]goex.Kline, error)
- func (e *OKEX) GetMinAmount(stock string) float64
- func (e *OKEX) GetName() string
- func (o *OKEX) GetOneOrder(orderId string, currency goex.CurrencyPair) (*goex.Order, error)
- func (o *OKEX) GetOrderHistorys(currency goex.CurrencyPair, opt ...goex.OptionalParameter) ([]goex.Order, error)
- func (o *OKEX) GetTicker(currency goex.CurrencyPair) (*goex.Ticker, error)
- func (o *OKEX) GetTrades(currencyPair goex.CurrencyPair, since int64) ([]goex.Trade, error)
- func (e *OKEX) GetType() string
- func (o *OKEX) GetUnfinishOrders(currency goex.CurrencyPair) ([]goex.Order, error)
- func (o *OKEX) LimitBuy(instId string, amount, price string, optional ...goex.OptionalParameter) (*goex.Order, error)
- func (o *OKEX) LimitSell(instId string, amount, price string, optional ...goex.OptionalParameter) (*goex.Order, error)
- func (e *OKEX) Log(msgs ...interface{})
- func (o *OKEX) MarketBuy(amount, price string, currency goex.CurrencyPair) (*goex.Order, error)
- func (o *OKEX) MarketSell(amount, price string, currency goex.CurrencyPair) (*goex.Order, error)
- func (e *OKEX) SetLimit(times interface{}) float64
- func (e *OKEX) Trade(options utils.OptionalParameter) interface{}
- type Option
- type Order
- type OrderBook
- type Position
- type Record
- type Ticker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Binance ¶
OKEX the exchange struct of okex.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 ¶
func (*Binance) GetExchangeName ¶
func (*Binance) GetMinAmount ¶
GetMinAmount get the min trade amonut of this exchange
func (*Binance) GetOneOrder ¶
func (*Binance) GetOrderHistorys ¶
func (o *Binance) GetOrderHistorys(currency goex.CurrencyPair, opt ...goex.OptionalParameter) ([]goex.Order, error)
func (*Binance) GetUnfinishOrders ¶
func (*Binance) LimitBuy ¶
func (o *Binance) LimitBuy(amount, price string, currency goex.CurrencyPair, opt ...goex.LimitOrderOptionalParameter) (*goex.Order, error)
func (*Binance) LimitSell ¶
func (o *Binance) LimitSell(amount, price string, currency goex.CurrencyPair, opt ...goex.LimitOrderOptionalParameter) (*goex.Order, error)
func (*Binance) MarketSell ¶
type Exchange ¶
type Exchange interface { GetKlineRecords(instId string, period goex.KlinePeriod, size int, optional ...goex.OptionalParameter) ([]goex.Kline, error) LimitBuy(instId string, amount, price string, optional ...goex.OptionalParameter) (*goex.Order, error) LimitSell(instId string, amount, price string, optional ...goex.OptionalParameter) (*goex.Order, error) //gx goex.API Log(...interface{}) GetType() string SetLimit(times interface{}) float64 AutoSleep() GetMinAmount(stock string) float64 }
Exchange interface
type OKEX ¶
type OKEX struct { *okex.OKExV5 *okex.OKExV5Swap *okex.OKExV5Spot // 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) CancelOrder ¶
func (*OKEX) GetExchangeName ¶
func (*OKEX) GetKlineFuture ¶
func (e *OKEX) GetKlineFuture(contractType string, currency goex.CurrencyPair, period goex.KlinePeriod, size int, options ...goex.OptionalParameter) ([]goex.Kline, error)
func (*OKEX) GetKlineRecords ¶
func (o *OKEX) GetKlineRecords(instId string, period goex.KlinePeriod, size int, optional ...goex.OptionalParameter) ([]goex.Kline, error)
func (*OKEX) GetMinAmount ¶
GetMinAmount get the min trade amonut of this exchange
func (*OKEX) GetOneOrder ¶
func (*OKEX) GetOrderHistorys ¶
func (o *OKEX) GetOrderHistorys(currency goex.CurrencyPair, opt ...goex.OptionalParameter) ([]goex.Order, error)
func (*OKEX) GetUnfinishOrders ¶
func (*OKEX) MarketSell ¶
func (*OKEX) Trade ¶
func (e *OKEX) Trade(options utils.OptionalParameter) interface{}
type Option ¶
type Option struct { TraderID int64 Type string Name string AccessKey string SecretKey string Passphrase string Test string HttpProxy string HttpsProxy string }
Option is an exchange option
type Order ¶
type Order struct { ID string //订单ID Price float64 //价格 Amount float64 //总量 DealAmount float64 //成交量 Fee float64 //这个订单的交易费 TradeType string //交易类型 StockType string //货币类型 Pnl float64 }
Order struct
type Position ¶
type Position struct { InstId string MgnMode string Price float64 //价格 Leverage int //杠杆比例 Amount float64 //总合约数量 ConfirmAmount float64 FrozenAmount float64 //冻结的合约数量 Profit float64 //收益 ContractType string //合约类型 TradeType string //交易类型 StockType string //货币类型 PosId string //持仓ID PosSide string //持仓方向,多还是空 }
Position struct
Click to show internal directories.
Click to hide internal directories.