Releases: alpacahq/alpaca-backtrader-api
Fetch Backfill Data Properly
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:
- 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
- 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).
- Compression - or not 1 minute/daily bars (e.g 5 minute, 30 minute, 60 minute bars)
- Polygon supports it. alpaca doesn't
- 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
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
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
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
when creating the StreamConn object we must make sure that the thread has an event loop.
Fix api response string formatting
In this release, we fix float/string converstion as returned from the alpaca API service.
Add more sample code
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
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
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.