Saturday 19 November 2016

JSE TOP40 Trajectory algorithm 30 day forecast



JSE TOP40 Trajectory algorithm 30 day forecast

Will start posting more of these more frequently. If you would like a brief description of how this is derived please see the forecasting tab. In short this is an objective mathematical analysis of the trend and seasonality in price of and index or share. The program uses this to analyse what these numbers and indicating to and using that to build a share price forecast. Will also upload a Top40 technical analysis.

Trajectory Forecasting algorithm

Background
This model was developed as a by product of a project that I was working on for a health care company specializing in hospital care. At the company I was investigating the optimal way to allocate nurses in hospitals to minimize cost to the company, as well as provide adequate care to the patients. During this process the idea for the trajectory algorithm was developed. 
Basics of how its works
The model makes use of mathematical formulas to identify trend and seasonally in number patterns. The algorithm is allowed to use 56 variables all affecting the output in different ways. The algorithm runs selecting the number of variables and the sizes of each dynamically over iterations to arrive at a final answer. 
What you need to know 
What must be stated is that this model is no guarantee nor is it claiming to predict the future. Its purpose it to provide an objective trajectory forecast based on past numerical data. 
The orange line is the actual index value movement for the last 250 trading days.
The blue line is the forecasted index value for the last 250 trading days. The point at which the orange line stops is where the forecast model starts its prediction for the next 30 trading days.
The green line is half a standard deviation of the index subtracted from the forecast data with a 6 day moving average. likewise the red line is the standard deviation of the index added to the forecast data with a 6 day moving average. 

Combined the top and bottom standard deviations are referred to as the "cloud" and once the 30 day forecast starts the standard deviations are referred to as the "forecasting cloud". This cloud is a confidence band that gives the user an absolute range in which price movement should occur. In periods of lower volatility the cloud will be narrower and in periods of high volatility the cloud will widen.



FTSE100 & JSE ALLSHARE index correlation 

This post looks at what the correlation is between moves on the FTSE100 and the JSE ALLSHARE to see if there is any links in how these indecies move.



 The first set of data that was looked at is seen above. 613 days of correlated trading on the FTSE100 and JSE ALLSHRE was used. The data was compared and two cases were assessed. These cases were: what is the correlation between the FTSE100 closing up and the JSE ALLSHARE also closing up, and what is the correlation between the FTSE100 closing down and the JSE ALLSHARE also closing down. 
The data was compiled and the results showed that on a day that the FTSE100 closed up, there was a 71.84% correlation that the JSE ALLSHARE also closed up. The same was done for the case of the FTSE100 closing down on a particular day and the JSE ALLSHARE also closing down which showed a 69.15% correlation.


The mean, standard deviation and correlation coefficient was also calculated for the days of correlated trading for the indices and the results can be seen above. The mean for the percentage movements for both indecies was very similar with the FTSE100 mean percentage movement coming to -0.01% and the JSE ALLSHARE coming to 0.03%. The Standard deviations were also similar with the FTSE100 equaling 0.98% and the JSE ALLSHARE equaling 0.99%.

The last set of analysis is the set up of a probability curve for analysing movements on the FTSE100 and the historical correlation of what would happen on the JSE ALLSHARE. The Y-axis is the confidence band this is the value that is added and subtracted to the percentage move on the FTSE100. The X-axis is the probability axis. 



How to use this curve is simple. The move on the FTSE100 is taken e.g. FTSE100 is up 0.5%. Then the user chooses the confidence band on the Y-axis (percentage deviation) for this example 0.8% is chosen. Then move across the Y-axis until you intersect with the curve and then move vertically down until you intersect with the X-axis and this is you probability. For this example the 0.8% confidence band chosen is subtracted from the 0.5%  move on the FTSE100 (= -0.3%) and the probability is attained using the curve. Moving across from 0.8 on the Y-axis the result is that there is a 71.6% probability that the JSE ALLSHARE closes above -0.3% based on the historical correlation between the FTSE100 and JSE ALLSHARE.

1 comment:

  1. Nice to have you back and thanks for all your input - it is great to learn from you!

    ReplyDelete