When using alpha_vantage to pull batch stock quotes for some reason get_batch_stock_quotes
does not return the quote for symbol "ARRS". However, if the function is called using only "ARRS" in the symbols list, the quote is returned. I don't want to make several individual calls if I can get all the quotes returned in one request.
Here's the test code:
import pandas as pd
from alpha_vantage.timeseries import TimeSeries
import time
api_key = '12BHXD9VVA9M1PUM'
ts = TimeSeries(key=api_key, output_format = 'pandas')
stocklist = ("ARRS","PCG","AAPL","ACB")
STOCK=""
PRICE=0
data, meta_data =ts.get_batch_stock_quotes(symbols=stocklist)
for label, row in data.iterrows():
STOCK=row[0]
PRICE=p=round(float(row[1]),2)
print (STOCK,PRICE)
Results:
$ python3 test8.py
PCG 11.67
AAPL 212.3
ACB 5.79
If I just use stocklist = ("ARRS")
the result is:
$ python3 test8.py
ARRS 31.64
Why does this happen? Thanks in advance.