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

Alternative for get_daily_adjusted? #21

Closed CyberBearSec closed 3 months ago

CyberBearSec commented 3 months ago

I have no issue eventually paying for premium endpoints but I am just now learning - your code is MUCH appreciated! - and I would like to avoid paying for learning. Whenever I run the ts.get_daily_adjusted call, I am told it is a premium endpoint - what free endpoint can I use that would not break the rest of your code?

imolitor commented 3 months ago

in the config part, replace

"key_adjusted_close": "5. close" with
"key_adjusted_close": "4. close"

in the download-data function use this for the time-series: ts.get_daily


def download_data(config):
    ts = TimeSeries(key=config["alpha_vantage"]["key"])
    data, meta_data = ts.get_daily(config["alpha_vantage"]["symbol"], outputsize=config["alpha_vantage"]["outputsize"])

and finally, in the plot section, there is an error (likely because of newer libraries. Remove the b=None setting in the following line:

plt.grid(which='major', axis='y', linestyle='--')

This should work now (as of 2024-03-27)

CyberBearSec commented 3 months ago

It works great now - thank you so much for taking the time to figure this out!