Share Price Analysis

This must be our most unusual project to date, combining both database techniques and mathematical modelling.

The basic principle is to segregate companies with shares traded on an international stock exchange into sectors, for example 'Chemicals', 'Property', 'Aerospace', etc. and to look for any pair of shares that historically has moved in synchronisation that has suddenly started to move out of synchronisation. The investor then sells (but has not yet bought) the share that has moved higher and buys the one that has moved lower. The investor then waits until the pair moves back into synchronisation, this time buying the one he originally sold and selling the one he originally bought.

The 'beauty' of this system is that it is independent of the overall movements in the market, based as it is, on the relative movement between two stocks.

  • Within a sector each company is paired with every other company.
  • The share price for each stock is downloaded daily.
  • The coefficient of correlation between the share prices of every possible pair of shares is calculated for the previous year.
  • Any deviation beyond certain limits in the relative price of the shares is identified and reported.

The main problems that had to be overcome in the design and implementation of this project were:

  • Within a sector each company is paired with every other company.
  • Handling the vast number of permutations and combinations that could be generated (18 stocks in one sector generates approximately 150 combinations).
  • The mathematical problem of calculating the correlation and standard deviations for each pair of stocks using a year's worth of data.

Surprisingly, having analysed the problem and worked out the mathematics it wasn't that difficult! We used Microsoft Access to record the data and from within Access called Excel functions to carry out the mathematics.

The result of the analysis is presented to the user in the form of a screen enquiry, listing the combinations within a sector in decreasing correlation, or in the form of a report that shows those pairs of stocks that have a) a correlation above a pre-defined theshold and b) diverged beyond a pre-defined limit. It is then in the hands of the investor to investigate the reasons for the divergence and to make an informed decision on how to react.

Share Price Correlation Results