Documentation
¶
Index ¶
- func NewExchange(Options map[string]interface{}) (banexg.BanExchange, *errs.Error)
- type China
- func (e *China) CalcMaintMargin(symbol string, cost float64) (float64, *errs.Error)
- func (e *China) CancelOrder(id string, symbol string, params map[string]interface{}) (*banexg.Order, *errs.Error)
- func (e *China) Close() *errs.Error
- func (e *China) CreateOrder(symbol, odType, side string, amount, price float64, ...) (*banexg.Order, *errs.Error)
- func (e *China) EditOrder(symbol, orderId, side string, amount, price float64, ...) (*banexg.Order, *errs.Error)
- func (e *China) FetchAccountPositions(symbols []string, params map[string]interface{}) ([]*banexg.Position, *errs.Error)
- func (e *China) FetchBalance(params map[string]interface{}) (*banexg.Balances, *errs.Error)
- func (e *China) FetchIncomeHistory(inType string, symbol string, since int64, limit int, ...) ([]*banexg.Income, *errs.Error)
- func (e *China) FetchOHLCV(symbol, timeframe string, since int64, limit int, ...) ([]*banexg.Kline, *errs.Error)
- func (e *China) FetchOpenOrders(symbol string, since int64, limit int, params map[string]interface{}) ([]*banexg.Order, *errs.Error)
- func (e *China) FetchOrder(symbol, orderId string, params map[string]interface{}) (*banexg.Order, *errs.Error)
- func (e *China) FetchOrderBook(symbol string, limit int, params map[string]interface{}) (*banexg.OrderBook, *errs.Error)
- func (e *China) FetchOrders(symbol string, since int64, limit int, params map[string]interface{}) ([]*banexg.Order, *errs.Error)
- func (e *China) FetchPositions(symbols []string, params map[string]interface{}) ([]*banexg.Position, *errs.Error)
- func (e *China) FetchTicker(symbol string, params map[string]interface{}) (*banexg.Ticker, *errs.Error)
- func (e *China) FetchTickerPrice(symbol string, params map[string]interface{}) (map[string]float64, *errs.Error)
- func (e *China) FetchTickers(symbols []string, params map[string]interface{}) ([]*banexg.Ticker, *errs.Error)
- func (e *China) GetLeverage(symbol string, notional float64, account string) (float64, float64)
- func (e *China) Init() *errs.Error
- func (e *China) LoadLeverageBrackets(reload bool, params map[string]interface{}) *errs.Error
- func (e *China) LoadMarkets(reload bool, params map[string]interface{}) (banexg.MarketMap, *errs.Error)
- func (e *China) MapMarket(exgSID string, year int) (*banexg.Market, *errs.Error)
- func (e *China) SetLeverage(leverage float64, symbol string, params map[string]interface{}) (map[string]interface{}, *errs.Error)
- type CnMarkets
- type Exchange
- type Fee
- type ItemMarket
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewExchange ¶
func NewExchange(Options map[string]interface{}) (banexg.BanExchange, *errs.Error)
Types ¶
type China ¶
func (*China) CalcMaintMargin ¶
func (*China) CancelOrder ¶
func (*China) CreateOrder ¶
func (*China) FetchAccountPositions ¶
func (*China) FetchBalance ¶
func (*China) FetchIncomeHistory ¶
func (*China) FetchOHLCV ¶
func (*China) FetchOpenOrders ¶
func (*China) FetchOrder ¶
func (*China) FetchOrderBook ¶
func (*China) FetchOrders ¶
func (*China) FetchPositions ¶
func (*China) FetchTicker ¶
func (*China) FetchTickerPrice ¶
func (*China) FetchTickers ¶
func (*China) GetLeverage ¶
func (*China) LoadLeverageBrackets ¶
func (*China) LoadMarkets ¶
type CnMarkets ¶
type CnMarkets struct { Exchanges map[string]*Exchange `yaml:"exchanges"` Contracts []*ItemMarket `yaml:"contracts"` Stocks []*ItemMarket `yaml:"stocks"` }
type Fee ¶
type ItemMarket ¶
type ItemMarket struct { Code string `yaml:"code"` Title string `yaml:"title"` Market string `yaml:"market"` Exchange string `yaml:"exchange"` Extend string `yaml:"extend"` Alias []string `yaml:"alias"` DayRanges []string `yaml:"day_ranges"` NightRanges []string `yaml:"night_ranges"` Fee *Fee `yaml:"fee"` Multiplier float64 `yaml:"multiplier"` // 合约乘数;价格单位是吨,每手含multiplier吨 PriceTick float64 `yaml:"price_tick"` // 最小价格变动,单位:吨 LimitChgPct float64 `yaml:"limit_chg_pct"` // 涨跌停板,单位:百分比 MarginPct float64 `yaml:"margin_pct"` // 保证金比率,单位:百分比 }
func (*ItemMarket) Resolve ¶
func (m *ItemMarket) Resolve(bases map[string]*ItemMarket)
func (*ItemMarket) ToRawSymbol ¶
ToRawSymbol 转为交易所Symbol
func (*ItemMarket) ToStdSymbol ¶
ToStdSymbol 转为标准Symbol,注意期货的年月需要提前归一化为4位数字
Click to show internal directories.
Click to hide internal directories.