Long term prediction using Artificial Neural Network

artificial-intelligence, neural-network

Solution

Maruf, if you have a reliable ANN predictor for 1 day ahead, please contact me to discuss further! LOL

Joking aside. Neural Networks and other non-linear predictors are just that - predictors. The data you are dealing with (stock price data) is largely random. If you don't believe me, try to generate a random walk using the following psuedo-code and plotting it on the screen:

let min = -0.5
let max = +0.5
let bias = 0.01
let random = rand(min, max)
y[i] = y[i-1] + random + bias

Adjust bias slightly (from -0.01 to 0.01) and you end up with series which looks a LOT like a trending stock price. The reason for this is in any underlying trend there are people that are making decisions no better than a coin flip. Did you know the average trader is right 55% of the time? That's all he needs...

Now, if the data is largely random then it becomes very hard to predict. You are looking for a signal in a large amount of noise. Every day ahead you try to predict your prediction becomes less accurate.

May I ask - what inputs have you put into the ANN to get a 1-day ahead prediction? If for instance you are using a daily stock prices plus other derived factors (such as rate of change, volumes, divergences etc...) to get an accurate 1-day prediction, you might find you can get an accurate 1 week prediction by substituting all the above with weekly stock data.

Edit:

Secondly, what are you doing to test accuracy of the predictor? To augment mikera's answer I would suggest a strategy such as the following.

Given a data window of 1000 days, take 800 of these and train your ANN. Now predict one day int he future. Compare the predicted direction (Up, Down) with the predicted closing price (% difference) to gauge accuracy for that result. Now slide the window 1 day to the right. Re-train the ANN and perform a 1 day prediction, noting results.

If you continue this for the remaining 200 days, what proportion of results got the correct direction (up, down)? What proportion of results were within 10% of the actual predicted closing price? If your ANN was placing orders at close of business of each day and closing them at the end of the next day, how much money would it have made? Accounting for slippage and trading fees of course ...

This will give you an idea of just how accurate and worthwhile the system is.

Problem

I am working on a project to predict stock price using ANN . I have trained the system using previous 7 years data and it works fine to predict data for one day . Now I want to predict stock price for next seven days . My Idea is to predict day 2 data using day 1 , day 3 data using predicted data of day 2 and day 1 and so on. But it's not working properly . I have trained ANN to predict closing price using opening price , maximum and minimum price of a day . What is the idea to predict data of next seven days ??

Original source