Get Bars does not return data
See original GitHub issueHi, perhaps this is because of v2 being in beta, if so makes sense. Although, I have confirmed the same issue on the v1 endpoint.
BASE_URL = URL('https://api.alpaca.markets')
ALPACA_API_KEY = 'xx'
ALPACA_SECRET_KEY ='xx'
api = alpaca.REST(key_id=ALPACA_API_KEY,
secret_key=ALPACA_SECRET_KEY,
base_url=BASE_URL)
now = pd.Timestamp.now(tz='America/New_York').floor('1min')
yesterday = (now - pd.Timedelta('1day')).strftime('%Y-%m-%d')
today = now.strftime('%Y-%m-%d')
tomorrow = (now + pd.Timedelta('1day')).strftime('%Y-%m-%d')
data = api.get_bars(symbol, TimeFrame.Hour, yesterday, today, adjustment='raw').df
print(f'{yesterday} - {today}')
print(data)
❯ python test.py
2021-03-17 - 2021-03-18
Empty DataFrame
Columns: []
Index: []
get_bars
returns an empty dataframe, I have tried various days and have tired different time frames and have the same issue. Some older random time intervals with some random time frames do occasionally work.
I did see this photo in the docs V2 api: https://alpaca.markets/docs/api-documentation/api-v2/market-data/alpaca-data-api-v2/historical/
Is this regarding V1 api as well? I tested this feature with the v1 endpoint using
BASE_URL = 'https://data.alpaca.markets/v1'
Same output.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Get_crypto_bars method not returning correct number of bars
I want to get the past day of minute bars. return self.api.get_crypto_bars( symbol = self.symbol, timeframe = alpaca_trade_api.TimeFrame.
Read more >d3 does not show bars with repeated data - Stack Overflow
I kindof see the fix as part of your answer itself. Look at the code you wrote here: function(d, i) { return "translate(0,"...
Read more >Bar chart not displaying output from DB - Ignition
Hello all, I am experiencing difficulties when trying to display result from SQL query from database (result of the query is on image...
Read more >Use data bars, color scales, and icon sets to highlight data
Format cells by using color scales. Color scales can help you understand data distribution and variation, such as investment returns over time. Cells...
Read more >Does TradingView's close variable return close price? · Kodify
That seems obvious and logical. But these bar variables have one counterintuitive feature: they don't always return the bar's final value. So ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I am no longer using Alpaca.
my bad, got the timeframe parameter wrong.