stock-prediction-deep-neural-learning icon indicating copy to clipboard operation
stock-prediction-deep-neural-learning copied to clipboard

something about yfinance and stock prediction

Open Moenya1030 opened this issue 2 years ago • 1 comments

Even if I update yfinance, it also shows error:

simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

I tried using the following code, but it didn't work : pip install yfinance --upgrade --no-cache-dir

And I uninstall and reinstall, but still filed. I will appreciate it if you have some ideas to solve this problem. And If the yfinance can't be used, how do I refactor the methods or classes related to yf?

As for the stock forecast, I notice that the stock data you downloaded includes closing price, opening price, highest and lowest price, etc. But you only use the closing price as the feature for model training and stock prediction. I think that multiple features can be used to predict stock prices, which can improve the accuracy of the forecast.

I try to change from these two directions, change the download, and change the feature number:

stock_prediction_numpy.py: data = yf.download([self._stock.get_ticker()], start=self._stock.get_start_date(), end=end_date)[['Close'],['Start'], ... ]

stock_prediction_numpy.py: model.add(LSTM(units=100, return_sequences=True, input_shape=(x_train.shape[1], featuresNum)))

I have no idea if it can work. Do you have any good ideas?

Thanks.

Moenya1030 avatar Dec 02 '21 08:12 Moenya1030

Hi @Moenya1030,

sorry for my late response. I'm running the project with Python 3.8 and everything seems to work correctly. Maybe you have some other issue that might help me identify what's wrong?

In terms of using multiple features, yes, there is a way but I haven't published anything yet. I might do later.

Cheers, Jordi

JordiCorbilla avatar Dec 09 '21 20:12 JordiCorbilla