Documentation
¶
Index ¶
Constants ¶
View Source
const ( Long = 1 Short = 2 )
View Source
const ( SymbolTypeSpot = "spot" SymbolTypeIndex = "index" SymbolTypeFutures = "futures" )
View Source
const ( CancelOne TradeType = -2 CancelAll TradeType = -1 DirectLong TradeType = 1 DirectShort TradeType = 1 << 1 Limit TradeType = 1 << 3 Market TradeType = 1 << 4 Stop TradeType = 1 << 5 Open TradeType = 1 << 6 Close TradeType = 1 << 7 OpenLong = Open | DirectLong OpenShort = Open | DirectShort CloseLong = Close | DirectLong CloseShort = Close | DirectShort // 130 StopLong = Stop | DirectLong // 33 StopShort = Stop | DirectShort // 34 )
Variables ¶
View Source
var ( OrderStatusFilled = "FILLED" OrderStatusCanceled = "CANCELED" )
Functions ¶
This section is empty.
Types ¶
type Candle ¶
type Candle struct {
ID int64 `xorm:"pk autoincr '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'"`
Volume float64 `xorm:"notnull 'volume'"`
Turnover float64 `xorm:"turnover 'turnover'"`
Trades int64 `xorm:"notnull 'trades'"`
Table string `xorm:"-"`
}
type CandleList ¶
type CandleList []*Candle
CandleList candle list
func (CandleList) High ¶
func (l CandleList) High() (ret float64)
func (CandleList) Low ¶
func (l CandleList) Low() (ret float64)
type Symbol ¶
type Symbol struct {
Name string `json:"name"`
Symbol string `json:"code"`
Exchange string `json:"exchange"`
Description string `json:"description"`
Type string `json:"type"`
// 交易时间
Session string `json:"session"`
// price decimal places
Precision int `json:"precision"`
// amount decimal places
AmountPrecision int `json:"volume_precision"`
Expired bool `json:"expired"`
// only use if expired = true
ExpirationDate time.Time `json:"expiration_date"`
Resolutions string `json:"resolutions"`
// mini size between two price
PriceStep float64 `json:"price_step"`
// mini size between two amount
AmountStep float64 `json:"amount_step"`
}
func (*Symbol) GetResolutions ¶ added in v1.1.6
type TradeAction ¶
type TradeAction struct {
ID string
Action TradeType
Amount float64
Price float64
Time time.Time
Symbol string
}
TradeAction trade action
Click to show internal directories.
Click to hide internal directories.