Documentation
¶
Index ¶
- Constants
- Variables
- type BaseExchanger
- type Config
- type ConfigItem
- type Contract
- type DataDownload
- func (d *DataDownload) Error() error
- func (d *DataDownload) IsFinish() (bFinish bool)
- func (d *DataDownload) Run(errChan chan error)
- func (d *DataDownload) SetFinish(nFinish int32)
- func (d *DataDownload) SetMaxRetry(maxRetry int)
- func (d *DataDownload) Start(err chan error) (dataCh chan []interface{})
- type DownFunc
- type DownParam
- type Downloader
- type FuturesBaseExchanger
- type FuturesExchanger
- type NewParamFunc
- type Position
Constants ¶
View Source
const ( Long = 1 Short = 2 )
Variables ¶
View Source
var (
ErrNotImpl = errors.New("not implement")
)
Functions ¶
This section is empty.
Types ¶
type BaseExchanger ¶
type Config ¶
type Config struct {
Exchanges map[string]ConfigItem
Proxy string
}
func LoadConfigFile ¶
func LoadConfigs ¶
func LoadViperConfig ¶ added in v1.0.5
type DataDownload ¶ added in v1.0.2
type DataDownload struct {
// contains filtered or unexported fields
}
func NewDataDownload ¶ added in v1.0.2
func (*DataDownload) Error ¶ added in v1.0.5
func (d *DataDownload) Error() error
func (*DataDownload) IsFinish ¶ added in v1.0.2
func (d *DataDownload) IsFinish() (bFinish bool)
func (*DataDownload) Run ¶ added in v1.0.2
func (d *DataDownload) Run(errChan chan error)
func (*DataDownload) SetFinish ¶ added in v1.0.2
func (d *DataDownload) SetFinish(nFinish int32)
func (*DataDownload) SetMaxRetry ¶ added in v1.0.5
func (d *DataDownload) SetMaxRetry(maxRetry int)
func (*DataDownload) Start ¶ added in v1.0.2
func (d *DataDownload) Start(err chan error) (dataCh chan []interface{})
type Downloader ¶ added in v1.0.5
type Downloader interface {
Start() chan []interface{}
Error() error
}
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) (data chan []interface{}, err chan error)
}
type NewParamFunc ¶ added in v1.0.2
type NewParamFunc func() DownParam
Click to show internal directories.
Click to hide internal directories.