Predict the future graph based on averages of given data

Question:

I am trying to make a future stock price forecaster, i am nearly done but the final step has stumped me.
How do i predict the future of the graph based on the different averages of given data?

#how it works up to now:
stockprice =[1, 2, 3, ... 9999]

#for every number in stock price, add that number till x amount(x would be input) numbers and divide them (calculate average)
StockDataSeperate = StockData_AverageFinder[-int_toSplitBy:-1]
            for num in StockDataSeperate:
                Average += num
            Average = Average / len(StockDataSeperate)
            Averaged_StockData = np.append(Averaged_StockData, Average)

#doing this x amount of times and exponentiating the number to average by, by x.

using this data (StockPrice averaged graphs), is it possible to predict the future of the raw data using the data averaged?
if anyone has any links or ideas i would be so greatful!

Asked By: Peter Cho

||

Answers:

Obviously, using a moving average for future values does not work since you don’t have values beyond the present. In theory you would assume that near-term stock prices follow a random walk, so you best guess for future value would be to simply predict the last known value.

However, a more "exciting" solution could be to train a LSTM by turning the stock price series into a supervised learning problem. It is important that you dont predict the price itself but the return between the stock prices in your time series. Of course you can also use the returns of moving averages as inputs or even multiple moving averages and conduct multivariate time series forecasting.

Hopefully, I don’t have to mention that stock price prediction is not that "easy" – it’s a good exercise though.

Answered By: OHennhoefer
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.