Documentation
¶
Index ¶
- Variables
- func Close() error
- func SubscribeBars(handler func(bar Bar), symbols ...string) error
- func SubscribeQuotes(handler func(quote Quote), symbols ...string) error
- func SubscribeTradeUpdates(handler func(update alpaca.TradeUpdate)) error
- func SubscribeTrades(handler func(trade Trade), symbols ...string) error
- func UnsubscribeBars(symbols ...string) error
- func UnsubscribeQuotes(symbols ...string) error
- func UnsubscribeTradeUpdates() error
- func UnsubscribeTrades(symbols ...string) error
- func UseFeed(feed string) error
- type Bar
- type Quote
- type Trade
Constants ¶
This section is empty.
Variables ¶
var ( // DataStreamURL is the URL for the data websocket stream. // The DATA_PROXY_WS environment variable overrides it. DataStreamURL = "https://stream.data.alpaca.markets" // MaxConnectionAttempts is the maximum number of retries for connecting to the websocket MaxConnectionAttempts = 3 )
Functions ¶
func SubscribeBars ¶
SubscribeBars issues a subscribe command to the given symbols and registers the handler to be called for each bar.
func SubscribeQuotes ¶
SubscribeQuotes issues a subscribe command to the given symbols and registers the handler to be called for each quote.
func SubscribeTradeUpdates ¶
func SubscribeTradeUpdates(handler func(update alpaca.TradeUpdate)) error
SubscribeTradeUpdates issues a subscribe command to the user's trade updates and registers the handler to be called for each update.
func SubscribeTrades ¶
SubscribeTrades issues a subscribe command to the given symbols and registers the handler to be called for each trade.
func UnsubscribeBars ¶
UnsubscribeBars issues an unsubscribe command for the given bar symbols
func UnsubscribeQuotes ¶
UnsubscribeQuotes issues an unsubscribe command for the given quote symbols
func UnsubscribeTradeUpdates ¶
func UnsubscribeTradeUpdates() error
UnsubscribeTradeUpdates issues an unsubscribe command for the user's trade updates
func UnsubscribeTrades ¶
UnsubscribeTrades issues an unsubscribe command for the given trade symbols
Types ¶
type Bar ¶
type Bar struct { Symbol string Open float64 High float64 Low float64 Close float64 Volume uint64 Timestamp time.Time }
Bar is an aggregate of trades