Documentation
¶
Overview ¶
Package indicatoralpaca provides Alpaca Markets inintegration for the Indicator technical analysis library.
Index ¶
- Constants
- type AlpacaBarsRepository
- func (*AlpacaBarsRepository) Append(_ string, _ <-chan *asset.Snapshot) error
- func (*AlpacaBarsRepository) Assets() ([]string, error)
- func (r *AlpacaBarsRepository) Get(name string) (<-chan *asset.Snapshot, error)
- func (r *AlpacaBarsRepository) GetSince(name string, date time.Time) (<-chan *asset.Snapshot, error)
- func (r *AlpacaBarsRepository) LastDate(name string) (time.Time, error)
Constants ¶
const ( // DefaultAlpacaBarsRepositoryTimeFrameUnit is the default time frame unit of a day. DefaultAlpacaBarsRepositoryTimeFrameUnit = marketdata.Day )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlpacaBarsRepository ¶ added in v1.0.1
type AlpacaBarsRepository struct {
// GetBarsRequestTemplate is the request template used to get the bars.
GetBarsRequestTemplate marketdata.GetBarsRequest
// contains filtered or unexported fields
}
AlpacaBarsRepository provides access to financial market data, retrieving asset snapshots, by interacting with the Alpaca Markets API. To use this repository, you'll need a valid API key from https://alpaca.markets.
func NewAlpacaBarsRepository ¶ added in v1.0.1
func NewAlpacaBarsRepository(apiKey, apiSecret string) *AlpacaBarsRepository
NewAlpacaBarsRepository initializes an Alpaca Markets repository with the given API key and API secret.
func NewAlpacaBarsRepositoryWithClient ¶ added in v1.0.1
func NewAlpacaBarsRepositoryWithClient(client *marketdata.Client) *AlpacaBarsRepository
NewAlpacaBarsRepositoryWithClient initializes an Alpaca Markets repository with the given client.
func (*AlpacaBarsRepository) Append ¶ added in v1.0.1
func (*AlpacaBarsRepository) Append(_ string, _ <-chan *asset.Snapshot) error
Append adds the given snapshows to the asset with the given name.
func (*AlpacaBarsRepository) Assets ¶ added in v1.0.1
func (*AlpacaBarsRepository) Assets() ([]string, error)
Assets returns the names of all assets in the repository.
func (*AlpacaBarsRepository) Get ¶ added in v1.0.1
func (r *AlpacaBarsRepository) Get(name string) (<-chan *asset.Snapshot, error)
Get attempts to return a channel of snapshots for the asset with the given name.