# Signals: Plugging in the data from Alpha Vantage

**URL:** <https://forum.numer.ai/t/signals-plugging-in-the-data-from-alpha-vantage/3295>\
**Category:** Signals\
**Created:** [May 14, 2021, 4:54am UTC](https://forum.numer.ai/t/signals-plugging-in-the-data-from-alpha-vantage/3295 "2021-05-14T04:54:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![surajp](https://yyz1.discourse-cdn.com/flex009/user_avatar/forum.numer.ai/surajp/32/2961_2.png) [@surajp](https://forum.numer.ai/u/surajp)\
**Post date:** [May 14, 2021, 4:54am UTC](https://forum.numer.ai/t/signals-plugging-in-the-data-from-alpha-vantage/3295/1 "2021-05-14T04:54:39Z")

</div>

[This script](https://github.com/numerai/example-scripts/tree/master/signals/alphavantage) uses data from [AlphaVantage](https://www.alphavantage.co/) using raw queries which do not require any extra library.

```auto
pip install numerapi tqdm

```

`numerapi` and `tqdm` (to check progress of downloads) are needed.

`key = "<ALPHAVANTAGE API KEY>"` **this needs to be set before running the script.**

AlphaVantage has a free key with a limit of 5 API calls per minute. For a limit of 75 calls per minute, you can pay $50 USD per month for a [premium key](https://www.alphavantage.co/premium/). This script was created for use with the 75 calls per minute plan so it would work. This takes around 13 mins to load all US stocks.

Alpha Vantage offers various types of data including stocks, cryptocurrencies, and technical indicators. [Documentation](https://www.alphavantage.co/documentation/).

### Data Loading

Since the API has a rate limit of calls per minute, this script provides two functions for loading the data.

- Sequential

- Parallel

### Feature Generation

- Since Alpha vantage has different types of data resolutions, this script uses **weekly data** (OHLC) to generate features.
- Some features are `simple moveing average` and `exponential moving average` of periods `[2, 5, 21, 50, 200]`.

I’d like to thank @_liamhz for the encouragement and feedback 🙂. All errors remain mine.

 ![Diagnostics](https://canada1.discourse-cdn.com/flex009/uploads/numerai/original/1X/2c5cc565100ad0703d9e8cb52f8b25b28a5c302f.png)

---

<div class="post-metadata">

**Author:** ![ihab](https://yyz1.discourse-cdn.com/flex009/user_avatar/forum.numer.ai/ihab/32/1029_2.png) [@ihab](https://forum.numer.ai/u/ihab)\
**Post date:** [July 2, 2021, 10:59pm UTC](https://forum.numer.ai/t/signals-plugging-in-the-data-from-alpha-vantage/3295/2 "2021-07-02T22:59:48Z")

</div>

Thank you very much @surajp and @_liamhz for this. Question, please:  
Have you tried this with the entire universe? if so, I am assuming that 75 API calls per minute were sufficient? And most importantly, were all tickers submitted valid by NumeraiSignals? Looking forward to hearing from you. Once again, a BIG THANK YOU!

---

<div class="post-metadata">

**Author:** ![surajp](https://yyz1.discourse-cdn.com/flex009/user_avatar/forum.numer.ai/surajp/32/2961_2.png) [@surajp](https://forum.numer.ai/u/surajp)\
**Post date:** [July 3, 2021, 6:43pm UTC](https://forum.numer.ai/t/signals-plugging-in-the-data-from-alpha-vantage/3295/3 "2021-07-03T18:43:04Z")

</div>

Thank you @ihab .

I tested on the intersection of the tickers that Numerai wants and the tickers that AV provides, It was ~3.2k ish common tickers (US is fully covered).

Since the common tickers are in Bloomberg format, they were accepted when I ran this script few weeks ago.
