Documentation ¶
Index ¶
- type SpotSim
- func (s *SpotSim) Buy(symbol string, orderType OrderType, price float64, size float64) (result *Order, err error)
- func (s *SpotSim) CancelAllOrders(symbol string, opts ...OrderOption) (err error)
- func (s *SpotSim) CancelOrder(symbol string, id string, opts ...OrderOption) (result *Order, err error)
- func (s *SpotSim) GetBalance(currency string) (result *SpotBalance, err error)
- func (s *SpotSim) GetHistoryOrders(symbol string, opts ...OrderOption) (result []*Order, err error)
- func (s *SpotSim) GetName() (name string)
- func (s *SpotSim) GetOpenOrders(symbol string, opts ...OrderOption) (result []*Order, err error)
- func (s *SpotSim) GetOrder(symbol string, id string, opts ...OrderOption) (result *Order, err error)
- func (s *SpotSim) GetOrderBook(symbol string, depth int) (result *OrderBook, err error)
- func (s *SpotSim) GetRecords(symbol string, period string, from int64, end int64, limit int) (records []*Record, err error)
- func (s *SpotSim) GetTime() (tm int64, err error)
- func (s *SpotSim) PlaceOrder(symbol string, direction Direction, orderType OrderType, price float64, ...) (result *Order, err error)
- func (s *SpotSim) RunEventLoopOnce() (err error)
- func (s *SpotSim) Sell(symbol string, orderType OrderType, price float64, size float64) (result *Order, err error)
- func (s *SpotSim) SetBacktest(backtest IBacktest)
- func (s *SpotSim) SetExchangeLogger(l ExchangeLogger)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SpotSim ¶
type SpotSim struct {
// contains filtered or unexported fields
}
func (*SpotSim) Buy ¶
func (s *SpotSim) Buy(symbol string, orderType OrderType, price float64, size float64) (result *Order, err error)
买
func (*SpotSim) CancelAllOrders ¶
撤销全部委托单
func (*SpotSim) CancelOrder ¶
func (s *SpotSim) CancelOrder(symbol string, id string, opts ...OrderOption) (result *Order, err error)
撤销单个委托单
func (*SpotSim) GetBalance ¶
获取账号余额
func (*SpotSim) GetHistoryOrders ¶
获取历史委托列表
func (*SpotSim) GetOpenOrders ¶
获取活跃委托单列表
func (*SpotSim) GetOrder ¶
func (s *SpotSim) GetOrder(symbol string, id string, opts ...OrderOption) (result *Order, err error)
获取委托信息
func (*SpotSim) GetOrderBook ¶
获取订单薄(OrderBook)
func (*SpotSim) GetRecords ¶
func (s *SpotSim) GetRecords(symbol string, period string, from int64, end int64, limit int) (records []*Record, err error)
获取K线数据 period: 数据周期. 分钟或者关键字1m(minute) 1h 1d 1w 1M(month) 1y 枚举值:1 3 5 15 30 60 120 240 360 720 "5m" "4h" "1d" ...
func (*SpotSim) PlaceOrder ¶
func (s *SpotSim) PlaceOrder(symbol string, direction Direction, orderType OrderType, price float64, size float64, opts ...PlaceOrderOption) (result *Order, err error)
下单
func (*SpotSim) RunEventLoopOnce ¶ added in v1.2.4
func (*SpotSim) Sell ¶
func (s *SpotSim) Sell(symbol string, orderType OrderType, price float64, size float64) (result *Order, err error)
卖
func (*SpotSim) SetBacktest ¶ added in v1.2.4
func (s *SpotSim) SetBacktest(backtest IBacktest)
func (*SpotSim) SetExchangeLogger ¶ added in v1.2.4
func (s *SpotSim) SetExchangeLogger(l ExchangeLogger)
Click to show internal directories.
Click to hide internal directories.