Skip to content

Releases: alpacahq/alpaca-backtrader-api

Fetch Backfill Data Properly

22 Jul 16:00
f0a3c9a
Compare
Choose a tag to compare

When running live we:

  • Get historic data (through the rest api)
  • Get live data (through the websocket)

This release fixes issues with fetching of the historic data:

  1. Date range is too large
    • Polygon api doesn't indicate a limit for 1 api call but you can't get six months of data in 1 api call (makes since).
      Data is returned corrupted (patchy data)
    • Alpaca has a limit of 1000 records per api call
  2. Compression - or not 1 minute/daily bars (e.g 5 minute, 30 minute, 60 minute bars)
    • Polygon supports it. alpaca doesn't
  3. Out of market data
    • Both apis return out of market hours data. that is of course not what we want when we do these calls

Bracket Order Support

18 Jul 06:39
cbd6161
Compare
Choose a tag to compare

just some final touch-ups on top of the rc1 release:

  • update backtrader version to 1.9.76.123
  • update alpaca-trade-api (python sdk) version to 0.49.0
  • change the frequency of pyup to once a week

Add Support for bracket orders

03 Jul 07:35
Compare
Choose a tag to compare
Pre-release

In this release we:

  • add support for bracket orders
  • fix alpaca_broker:getvalue() to handle datas as input
  • support order create with data name defined in _name or _dataname
  • backfill for minute data didn't work as expected
  • add pyup integration
  • make sure that the _t_order_create() thread is never broken

Support the new Alpaca data API

14 May 09:10
93d90cc
Compare
Choose a tag to compare

In this release we add support for the alpaca data api: https://alpaca.markets/docs/api-documentation/api-v2/
to select the data source set usePolygon like so:

alpaca_backtrader_api.AlpacaStore(
    key_id=ALPACA_API_KEY,
    secret_key=ALPACA_SECRET_KEY,
    paper=True,
    usePolygon=True
)

sdk version: alpaca-trade-api==0.48
by default we use alpaca data source

Fix - make sure we have an event loop

30 Apr 15:52
ececa7b
Compare
Choose a tag to compare
Pre-release

when creating the StreamConn object we must make sure that the thread has an event loop.

Fix api response string formatting

12 Apr 15:00
44cf9b6
Compare
Choose a tag to compare

In this release, we fix float/string converstion as returned from the alpaca API service.

Add more sample code

03 Apr 07:38
965c69c
Compare
Choose a tag to compare

In this release, we added more sample code to get you started with the alpaca-backtrader integration.
you could find it under the sample/ folder.

also fixed the broker.positions for paper/live execution, which makes sure you get the right position data by any of these ways:

  • self.position (self is a strategy)
  • self.positions
  • self.positionsbyname
  • self.getpositionbyname
  • self.getposition
  • self.broker.positions

Properly format dates used with the API

31 Mar 14:06
6b12c70
Compare
Choose a tag to compare

In this release, we make sure that dates are formatted properly when calling the historic_agg_v2 according to isoforamt dates.

Use polygon historic agg v2

31 Mar 06:36
Compare
Choose a tag to compare

In this release, we move to Polygon historic_agg_v2. Polygon historic agg v1 has been deprecated. Support for v2 was already added in alpaca-trade-api-python v0.42. Now we will call that directly.