market.go 720 B

1234567891011121314151617181920212223242526
  1. package sentio
  2. import (
  3. "time"
  4. )
  5. type Market interface {
  6. Clock() Clock
  7. IsOpen() bool
  8. Connect(done chan struct{}) (chan MarketConnection, error)
  9. Subscribe(symbols ...string) error
  10. Account() (MarketAccount, error)
  11. CreateOrder(symbol string, quantity uint, sl float64) (Order, error)
  12. UpdateOrder(orderID string, sl float64) error
  13. CloseOrder(order Order) (Order, error)
  14. Order(orderID string, nested bool) (Order, error)
  15. Orders(criteria OrderListCriteria) ([]Order, error)
  16. Portfolio() (Portfolio, error)
  17. PortfolioHistory() ([]PortfolioRecord, error)
  18. Quotes(symbols ...string) (map[string]Quote, error)
  19. HistoricalBars(symbols []string, interval time.Duration, from *time.Time) (map[string][]Bar, error)
  20. }