jinglescode / time-series-forecasting-pytorch

Acquiring data from Alpha Vantage and predicting stock prices with PyTorch's LSTM
https://www.alphavantage.co/academy/#lstm-for-finance
Apache License 2.0
203 stars 84 forks source link

free API key not sufficient to download the price chart? #11

Closed TremotinoVolante closed 2 years ago

TremotinoVolante commented 2 years ago

Hello,

I'm a student from the Technical University of Munich and I would like to try out this code for educational reasons. With my free API key I get this error:

ValueError: Thank you for using Alpha Vantage! This is a premium endpoint and there are multiple ways to unlock premium endpoints: (1) become a holder of Alpha Vantage Coin (AVC), an Ethereum-based cryptocurrency that provides various utility & governance functions within the Alpha Vantage ecosystem (AVC mining guide: https://www.alphatournament.com/avc_mining_guide/) to unlock all premium endpoints, (2) subscribe to any of the premium plans at https://www.alphavantage.co/premium/ to instantly unlock all premium endpoints

Since I'm insterested more in learning than using it for real investment, does alpha vantage also provide randomised data for feeding the LSTM model? It would really help, as it would take some time and understanding to adapt other free data sources to mach exactly to the structure of the downloaded price chart data structure from alpha vantage API.

thank you!

jinglescode commented 2 years ago

Claim your API key here: https://www.alphavantage.co/support/#api-key

does alpha vantage also provide randomised data for feeding the LSTM model

No, you have to do your own preprocessing

TremotinoVolante commented 2 years ago

Thank you for your fast reply! I have generated my API key here: https://www.alphavantage.co/support/#api-key I have actually tried it twice, both keys didn't work. I always get the same error. I use alpha_vantage 2.3.1 The code line

TimeSeries(key=config["alpha_vantage"]["key"])

is working fine and gets the right key.

Luo-Chang commented 2 years ago

Because get_daily_adjusted is a premium feature. You can use get_daily instead.

TremotinoVolante commented 2 years ago

Because get_daily_adjusted is a premium feature. You can use get_daily instead.

Thank you for your answer! I would not have figured it out!

Also, in config under "alpha_vantage", "key_adjusted_close" must be set to for instance "4. close" instead of "5. adjusted close".