Artificial Intelligence on SGX - Novice Views

Lots have been written on using AI for stock prediction.

I am curious to understudy the effectiveness.

There are many potential algorithms to use. Based on several internet blogs and posting, I have chosen LSTM to train the model.

Historical data can be downloaded from Yahoo Finance,

I use the past 5 years of data to train the model. 2013 to 2018.

first 5 rows
first 5 training rows

Last five training Rows
Last five training Rows
The model is below. There are couple of hidden layers to train. we use the past 60 days data to predict the next day price.

LSTM Model
LSTM Model
After training the model, the graph looks like below. it shows the start point and end point matches over the period.

actual and predicted prices
actual and predicted prices
Predicted Number
The predicted number is 8.79. IT is believed that the stock will likely tend downwards.

Let's take a look at the end of the day result from SGX.

The stocked closed at 8.66. Looks like it passes the 8.79 point in the morning.
SGX Day Price
SGX Day Price

I am trying to look for another feature variable to add to the model as one can observe the dive of the stock price is due to the another event which is the tension of Middle East between USA and Iran.

Let try again on Monday to see how the model fares.

Please see my blog to see my disclaimer. 

Comments