123456789101112131415161718192021222324252627282930313233 |
- package sentio
- import (
- "context"
- "errors"
- )
- var (
- ErrMarketClosed = errors.New("market is closed")
- ErrTooSmallOrder = errors.New("too small order size")
- )
- type Market interface {
- Talib
- Connect(done chan struct{}) (chan MarketConnection, error)
- Subscribe(symbol string) error
- IsMarketOpened() bool
- Time() Clock
- LatestBar(symbol string) (Bar, error)
- Buy(ctx context.Context, symbol string, ratio float64) (Order, error)
- Sell(ctx context.Context, symbol string, ratio float64) (Order, error)
- CancelOrder(id string) error
- Orders() ([]Order, error)
- Portfolio() (Portfolio, error)
- AvailableCash() (float64, error)
- MaxBudget() float64
- }
|