AlpacaCollector

class src.boatwright.Data.OHLCV.Historical.AlpacaPyCollector.AlpacaPyCollector(api_key=None, secret_key=None, crypto=False, debug=False)

Collects historical data via Alpaca API, using the AlpacaPy SDK

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

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

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

  • api_key (str)

  • crypto (bool)

collect(symbol, start, end, granularity='MINUTE')

Collects historical bars for the given symbol and date range. :param symbol: e.g. “AAPL” or “BTC-USD” :param start: start date :param end: end date :param granularity: “MINUTE”, “HOUR”, or “DAY”

Parameters:
  • symbol (str)

  • start (datetime)

  • end (datetime)

  • granularity (str)