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