AlpacaCollector

class src.boatwright.Data.Collection.Historical.AlpacaCollector.AlpacaCollector(debug=False, key=None, secret_key=None)

Collects historical data via Alpaca API

Parameters:
  • debug (bool) – boolean toggle to print debugging information to terminal

  • key (str) – Alpaca API key, defaults to key specified config.json

  • secret_key (str) – Alpaca API secret key, defaults to secret key specified config.json

collect(symbol, start, end, granularity_unit='MINUTE', verbose=False)

returns dataframe with columns: timestamp, open, low, high, close, volume

Parameters:
  • symbol (str) – e.g. “BTC”

  • start (date) – collection start date

  • end (date) – collection end date

  • granularity_unit (str) – “MINUTE”, “HOUR”, or “DAY”

  • verbose (bool) – boolean toggle for printing progress to terminal