Documentation ¶
Index ¶
Constants ¶
View Source
const ( Long = 1 Short = 2 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionType ¶
type ActionType int
const ( ActionBuy ActionType = iota ActionSell ActionOpenLong ActionCloseLong ActionOpenShort ActionCloseShort )
func (ActionType) String ¶
func (at ActionType) String() (msg string)
type BaseExchanger ¶
type Candle ¶
type Candle struct { ID int64 `xorm:"pk autoincr null 'id'"` Start int64 `xorm:"unique index 'start'"` Open float64 `xorm:"notnull 'open'"` High float64 `xorm:"notnull 'high'"` Low float64 `xorm:"notnull 'low'"` Close float64 `xorm:"notnull 'close'"` VWP float64 `xorm:"notnull 'vwp'"` Volume float64 `xorm:"notnull 'volume'"` Trades int64 `xorm:"notnull 'trades'"` Table string `xorm:"-"` }
type Config ¶
type Config struct { Exchanges map[string]ConfigItem Proxy string }
func LoadConfigFile ¶
func LoadConfigs ¶
type ConfigItem ¶
type FuturesBaseExchanger ¶
type FuturesBaseExchanger interface { BaseExchanger OpenLong(price float64, amount float64) (*Order, error) CloseLong(price float64, amount float64) (*Order, error) OpenShort(price float64, amount float64) (*Order, error) CloseShort(price float64, amount float64) (*Order, error) OpenLongMarket(amount float64) (*Order, error) CloseLongMarket(amount float64) (*Order, error) OpenShortMarket(amount float64) (*Order, error) CloseShortMarket(amount float64) (*Order, error) }
type FuturesExchanger ¶
type FuturesExchanger interface { FuturesBaseExchanger Contracts() ([]Contract, error) Positions() ([]Position, error) ContractBalances() (map[Contract]Balance, error) Depth(int) (Orderbook, error) Ticker() (Ticker, error) SetSymbol(symbol string) error SetContract(contract string) error SetLever(lever float64) error KlineRecent(count int32, binSize string) (klines []*Candle, err error) Kline(start, end time.Time, nLimit int, binSize string) (klines []*Candle, err error) KlineChan(start, end time.Time, bSize string) (klines chan []interface{}, err error) }
type TradeAction ¶
type TradeAction struct { Action ActionType Amount float64 Price float64 Time time.Time }
func (*TradeAction) IsBuy ¶
func (ta *TradeAction) IsBuy() bool
Source Files ¶
Click to show internal directories.
Click to hide internal directories.