123456789101112131415161718192021222324252627282930313233 |
- package sentio
- import (
- "errors"
- "time"
- )
- var (
- ErrMarketClosed = errors.New("market is closed")
- ErrTooSmallOrder = errors.New("too small order size")
- )
- type Market interface {
- Clock() Clock
- IsOpen() bool
- Cooldown() uint8
- Connect(done chan struct{}) (chan MarketConnection, error)
- Subscribe(symbols ...string) error
- Account() (MarketAccount, error)
- CreateOrder(symbol string, quantity uint, sl float64) (Order, error)
- UpdateOrder(orderID string, sl float64) error
- CloseOrder(orderID string) (Order, error)
- Order(orderID string, nested bool) (Order, error)
- Orders(criteria OrderListCriteria) ([]Order, error)
- Portfolio() (Portfolio, error)
- PortfolioHistory() ([]PortfolioRecord, error)
- Quotes(symbols ...string) (map[string]Quote, error)
- HistoricalBars(symbols []string, interval time.Duration, from *time.Time) (map[string][]Bar, error)
- }
|