2
0

mkt.go 677 B

1234567891011121314151617181920212223
  1. package sentio
  2. import (
  3. "context"
  4. "time"
  5. )
  6. type MKT interface {
  7. IsOpen() bool
  8. Cooldown() uint8
  9. Account() (MarketAccount, error)
  10. CreateOrder(ctx context.Context, symbol string, quantity uint, sl float64) (Order, error)
  11. UpdateOrder(ctx context.Context, orderID string, sl float64) error
  12. CloseOrder(ctx context.Context, orderID string) (Order, error)
  13. Orders(ctx context.Context, status string, nested bool) ([]Order, error)
  14. Portfolio() (Portfolio, error)
  15. PortfolioHistory() ([]PortfolioRecord, error)
  16. Quotes(ctx context.Context, symbols ...string) (map[string]Quote, error)
  17. HistoricalBars(symbol string, interval time.Duration, from *time.Time) ([]Bar, error)
  18. }