Optimising Financial Portfolios - Department of Physics - University ...

Final Year Project ‘05/`06**Optimising** **Financial** **Portfolios**Waqqas ArifSupervisor: Dr. David Faux**Department** **of** **Physics**,**University** **of** Surrey,Guildford, GU2 7XHAbstract:A financial model aimed at optimising portfolios was designed keeping in mind theincrease in online portfolio selection. This was implemented using a simple modelsuggested by Helmbold et al [1] as the basis and then modified in to includeparameters such as transaction costs and trade limiters. The impact **of** volatility wasalso observed in the model. The results obtained were encouraging but inconclusiveas to whether this model can be developed into an optimisation tool. Under certaincircumstances a positive return **of** wealth was calculated on the investment, however,it could not be put beyond statistical doubt stressing the need for more empiricalresearch on the matter. Finally, it was concluded that this model may work better withthe implementation **of** newer techniques **of** finding optimal solutions such as NeuralNetworks that can also be taught how to adapt to find the best solutions.1

Table **of** ContentsTOPIC……………………………………………………………………………….PAGEAbstract…………………………………………………………………..11. Introduction……………………………………………………………32. Theoretical Background….....................................................................33. Procedure……………………………………………………………....54. Results and Discussions…….………………………………………....74.1. Bid-Offer Spreads and Volatilities………………………….........74.2. Basic Model and Cumulative Wealth…………………………...84.3 Impact **of** Transaction Costs…………………………………105. Conclusions……………………………………………………….….116. Acknowledgements……………………………………………….….117. References……………………………………………………………128. Appendices………………………………………………………….132

1. IntroductionWith the rapid increase in the popularity **of** the internet over the past decade, onlineportfolio selection has become popular practice amongst potential investors, be it forsmall-scale personal investments or for a carefully thought out long term investmentsstrategy. Thus, a large number **of** financial analysts are interested in investigatingwhether a certain degree **of** success may be attained by creating financial models foronline trading.This report investigates the feasibility and pr**of**itability **of** a financial model that isloosely based on a simple idea, put forth by Helmbold et al, that states twoinvestments (a current account and a highly volatile stock that alternates between twovalues) that are pretty stagnant on their own can be used simultaneously to increasethe investors wealth exponentially. A simple way **of** doing this is to divide yourinvestment evenly between the two at the end **of** each day. [1] Keeping the above inmind a model was designed to adapt this system to real stock quotes from the past 5years **of** various companies.2. Theoretical BackgroundThe stock market has been the cause **of** many success stories and conversely thedownfalls **of** many investors; its unpredictable nature makes it a very fascinatingsubject for speculators. However, trading in stocks can also be the source **of** greatwealth, thus analysts and financial companies are constantly trying to optimiseearnings whilst minimising the risks involved. There have been many optimisationalgorithms written to address these issues and to date complex mathematical systemsare being designed to simulate the environment **of** the stock market, in order toprovide a better chance to predict and pr**of**it from stock investments, whilst limitingthe risks involved.3

The simplest way **of** reducing risk is by investing in a portfolio rather than a singlestock. A portfolio, in the financial sense, can be defined as "a collection **of**investments held by an institution or individual". [2] The investor thus is protectedfrom losing a large percentage or all **of** their investment just because one share, bondor other form **of** investment suffered a sharp decline. The trade-**of**f however is that if acertain share did well the investor would not be able to earn the maximum return fromthat particular stock due to having alternative investments. The uncertainty is enoughthough to encourage buyers in the stock exchange to employ portfolios and thus is anintegral part **of** this investigation.Looking to optimise portfolios is not a recent consideration and has been around sincethe 1950’s. One **of** the pioneers **of** mathematical implementation **of** financialportfolios was Markowitz, who managed to write an algorithm to try and optimiseportfolios at certain levels **of** risk. [3] The model has been identified as the basis **of**most **of** the current modifications to work done in the field despite its limited practicalsuccess. [4] From the above examples it is generally seen that modelling stocks in thisway can be useful and should be undertaken to help increase the efficiency andperformance **of** portfolios.A major aspect **of** trading on-line is transaction costs. Almost all private investorshave a third-party influence on their purchases in the share market. Normally, brokersare responsible for mediating between the stock exchange and potential buyers andcharge a fee for their services. There are other costs involved ranging from taxconsiderations to charges made by the stock exchange in order to advertise thesesecurities and thus improving their tradability. It has been determined that transactioncosts are a major factor in determining the success **of** any model aimed at achievinguniversal success regardless **of** stock market movements. [5] This was contrary to theMarkowitz models and its early derivatives as they assumed complete and frictionlessmarkets. It is quite obvious though that in order to make models more realistic thesecosts had to be factored into the investigation.Another factor that is looked at in this study is the bid-**of**fer spread **of** shares and howit may impact portfolio selection. Since, the model is essentially based on highvolatility stocks it is extremely likely that the bid-**of**fer spread (normally quite high4

for volatile shares) is going to make a significant difference. Bid-**of**fer spread is seenas the difference in the price to sell and purchase investments. It is generally used bywholesalers to make their pr**of**its buying the shares at the lower bid price and sellingthem at the higher **of**fer price. [6] It is this difference and other transaction costsdiscussed above that make the market biased in terms **of** the invested amount. In aperfect market it wouldn’t matter whether the investor had £1 to spend or £1 million,the percentage returns would be the same. However, since each transaction made hasa cost allocated to it a small amount **of** money will quickly disappear as a greaterproportion is lost to the costs in comparison to a larger investment. This logic shouldalso hold in the model as a rough guide to ensure that the results are sensible.3. ProcedureThe basis **of** the model were two series one repetitive and another alternating, thus itwas clear that this could be implemented easily to generate number in a spreadsheetbased s**of**tware for this purpose Micros**of**t Excel was used. The first step inimplementation **of** the model was to select candidates for the portfolio. Since theoriginal model discussed earlier stated that the alternating stock has a high volatility itis used as the basic criteria for selection, initially. The volatility calculation was basedon daily returns (calculated from share data) the logs **of** which were then found andultimately their standard deviation was taken (Refer to Equation. [1.1] below). Thisprovided a numerical value that could be described as the daily volatility **of** the shareprice.The volatility **of** a share price is a useful indicator as to its potential pr**of**itability andalso the stability **of** the investment. In this study however since getting close tooptimisation is the target the risk limitation element is reserved for the portfolio andthus volatile shares are preferred. Volatility can be defined as “the relative rate atwhich the price **of** a security moves up and down. Volatility is found by calculatingthe annualized standard deviation **of** daily change in price. If the price **of** a stockmoves up and down rapidly over short time periods, it has high volatility. If the pricealmost never changes, it has low volatility.” [7] Thus shares **of** highly established5

companies (e.g. Vodafone, Micros**of**t etc) are not normally very volatile, they havehigh trading volumes but both demand and supply are normally quite high and thusthe prices rarely undergo a large percentage change. It can be calculated through thefollowing equation:[1.1]Where may represent share prices. [8]The volatility function was implemented into an Excel model and the returns werefitted into normal distributions for different periods **of** time. This was a gaugingmethod to check the stability **of** the volatility calculator and to ensure that thecalculations were reasonable. (Screenshot **of** Volatility Calculator in Appendix 8.2)The next step in the development **of** the model was to emulate the basic two stockmethod discussed in Section 1 above and ensure that it allowed the wealth to go upexponentially, this was achieved quite easily by using three columns in Excel. Theexponential growth is demonstrated (in Appendix 8.1) below. Then real historical datawas used from a single stock and the exact same skeleton was run with a startinginvestment amount **of** £100,000 as a simulation. Various companies were tested forthis method and the ones that yielded positive value to this method were then takenfurther.This method involved having two columns **of** data one to represent the currentaccount and another to represent the amount **of** money in a particular stock. At anygiven time the sum **of** the two was treated as the total wealth **of** the investor. Thecolumns were added together and equated, at first, every single day and the remainingamount **of** money in the stock was subject to the rise or fall in the value **of** stocks(through multiplication with a third column containing historical share data). Thisvalue was then used as the updated stock value and averaged over the two accountsagain and so on. Another column summed up corresponding squares **of** the currentaccount and the stock account to generate the total worth **of** the investor at any givenpoint in time; this was then used to measure the net gain/loss **of** that company andsubsequently the extent to which the model had been successful. The working **of** this6

model is illustrated by a flow diagram in Appendix 8.4 below and a screenshot inAppendix 8.3.The portfolio selection was a time-consuming process and involved putting dozens **of**companies through the system to single out firms that may yield the best and mostinteresting results. Once a list **of** firms was more or less finalised the procedure wastaken onto the result gathering phase. This involved investigating the ability **of** themodel to sustain positive returns throughout the study and the hope was to extend thisto other portfolios with a similar measure **of** success leading to the formation **of** auniversal portfolio optimiser. The results **of** these observations were then collectedand collated.4. Results and DiscussionsThe various factors that were being investigated in the report included a measure **of**volatilities. The volatility **of** a share price can go a long way in determining whetheror not that investment is worth making. In this study the volatilities were used as abasic measure to compare performances **of** firms and enable the use **of** a cross-section**of** firms with a range **of** volatilities. In particular, stocks with high volatilities werelooked at as they tend to provide the possibility **of** a higher percentage returnaccording to the normal distribution.4.1. Bid-Offer Spreads and VolatilitiesAn interesting measure for choosing firms for the investigation was to find the ratiobetween the volatility and the bid-**of**fer spread. Figure 1.1 below shows thecomparison **of** various firms’ Bid-Offer Spreads and their respective volatilities.7

Fig. 1.1: Bid-Offer Spread vs Volatility1.61.4Bid-Offer Spread (%)1.210.80.60.4y = -0.0029x + 0.66160.200 10 20 30 40 50 60 70 80 90 100Volatility (%)The above graph demonstrates the negative and linear relationship between the bid**of**ferspread and volatility. This was further supported by a statistical correlation **of**-0.16. Although not extremely high there is evidence suggesting that the twoquantities are related, this could however just be a statistical anomaly since thecorrelation is low enough for there to be considerable doubt. Putting the result intocontext it would mean that normally the bid-**of**fer spread is low when a highly volatilestock is traded. This doesn’t make sense as a market maker would want to ensure thatthey do not lose out on pr**of**its due to overtrading **of** the stock especially for smallchanges in the share price. The relatively higher difference between the bid price and**of**fer price provides less incentive for traders or stock holders to cash in on a smalljump in shares **of** high volatility. Thus, more companies need to be included to studythis impact with comprehensive support from empirical evidence.4.2. Basic Model and Cumulative WealthHaving established this result we were then able to take into consideration the effecton substituting a single real stock’s historical data and investigating whether or notthe basic model would be able to produce a positive return. This situation was8

extremely simplistic and a trade was triggered every single day to equate the twoaccounts. Fig 2 shows the contrast in total wealth **of** a few stocks when treated withthe same model individually.180000160000Figure 2: Comparison **of** Total Wealth vsTime for Various Companies in the BasicModelCumulative Wealth (£)14000012000010000080000600004000020000MICE GroupACLANTOCEYCFN00 200 400 600 800 1000 1200 1400 1600 1800Time (days)The above graph shows very encouraging results pertaining to the ability for thismodel to generate positive returns. Four out **of** five companies tested yielded positiveresults. The companies were selected on the basis **of** their volatilities which rangedfrom 15% to 86%. This is extremely encouraging and the only stock to have resultedin an overall loss was one that had been continuously dropping over the duration **of**the data collected. On initial sight this result tends to suggest that the model has greatpotential even if stocks were to be traded every single day, strongly advocating thepossibility **of** optimisation. However, not enough variables were considered andfurther investigation was deemed necessary. In order to take this further the effect **of**transaction costs was observed on each **of** the companies involved, this was expectedto lower the total wealth considerably especially in this basic model as the currentaccount and the stock were balanced every single day.9

4.3 The Impact **of** Transaction CostsCumulative Wealth (£)Fig. 3: Comparison **of** Cumulative Wealths withTransaction Costs160000140000120000100000800006000040000200000ACLANTOCEYCFNMEG0 500 1000 1500 2000DaysThe above figure depicts the changes in total wealth for the same 5 companies aftertaking into account a £10/transaction cost. The progressions are still healthy howeverit is becoming evident that despite volatile stocks only 2 out **of** the 5 companies haveyielded positive wealth, however on the plus side the net change in wealth for each **of**them is still greater than zero (thanks to the highly pr**of**itable result producedespecially by ANTO).The above data is extremely encouraging and demands further investigation into theplausibility **of** such a model, the overall value **of** the wealth based on historical datawas slightly positive but this is not sufficient to justify the usage **of** the model toproject portfolios as certainties when it comes to generating pr**of**its. A useful method**of** countering this problem may be to use a better optimisation tool such as thetechnique known as Neural Networks. The advantage **of** a system developed withNeural Networks would be that it is adaptive in nature and will thus be potentiallyable to learn how to adjust trading based on certain patterns, [9] if enough empiricaldata can be collected and tested then this model may be an ideal optimisation solutionfor trading in the stock exchange.10

5. ConclusionsThe results discussed above provide a solid background for further study in thissubject and **of**fer the possibility **of** developing a very simple but effective method **of**generating a pr**of**itable financial portfolio. The Helmbold suggestion [1] was takenand worked on using historical data from the London Stock Exchange and ended witha few instances **of** positive wealth generation. This included instances wheretransaction costs were taken into account as suggested by Albeverio et al. [5]However, a broader study covering more stocks is necessary to test the efficiency **of**this model and also to determine whether or not this degree **of** success is possible withmore diverse portfolio selections.Finally, it was also suggested that there are other computational modelling techniquessuch as neural networks that may be better suited to run this kind **of** data-basedcalculation. The neural networks will ultimately develop a set **of** adaptabilityparameters that can be cloned to perform under real market conditions with a greaterpossibility **of** success. [9] This coupled with the criteria for portfolio selection couldlead to the formation **of** an effective optimisation tool.6. AcknowledgementsI would like to thank Dr. David Faux, my supervisor, for his unreserved support andadvice throughout the duration **of** this project. His advice and suggestions went a longway in helping compile and direct my findings11

7. References1. Helmbold, D. P., R. E. Schapire, Y. Singer and M. K. Warmuth, ON-LinePortfolio Selection using Multiplicative Updates, Mathematical Finance Vol.8, No. 4 (Oct. 1998), 325-347.2. Web Reference: http://en.wikipedia.org/wiki/**Financial**_portfolio3. Harry M. Markowitz, The Journal **of** Finance, Vol. 46, No. 2. (Jun., 1991), pp.469-477.4. http://accounting.uwaterloo.ca/finance/casf/documents/Erdogan_Goldfarb_Iyengar2004-11.pdf5. Albeverio, S. , L. J. Lao and X. L. Zhao, Online Portfolio Selection Strategywith Prediction in the Presence **of** Transaction Costs. Math Meth Oper Res(2001) 54:133-161.6. http://www.finance-glossary.com/terms/bid/**of**ferspread.htm?ginPtrCode=00000&id=151&PopupMode=7. Web Reference: http://www.investorwords.com/5256/volatility.html8. Web Reference: http://www.riskglossary.com/link/volatility.htm9. Aleksander, I. and Morton, An introduction to Neural Computing., H. 2ndedition10. Historical Share Data from: finance.uk.yahoo.com12

8. AppendicesAppendix 8.1:Appendix 8.1: Chart displaying the exponential nature **of** Wealth increase in the model8E+267E+266E+26Overall W ealth (£)5E+264E+263E+26y = 0.6779e 0.2232xSeries1Expon. (Series1)2E+261E+2600 50 100 150 200 250 300Time (Days)Appendix 8.2: The Volatility Calculator13

Appendix 8.3: Screenshot **of** The Basic Model CalculatorAppendix 8.4: A flow chart showing how the above model basically works.Set Initial Amount/Current Account asthe new amount to spend and apply toDownloaded Data.Calculate amount in shares and updatethe amount according to change inshare price and listed parameters (i.e.transaction costs.).Sum share holdings column and currentaccount column and balance them. Usesummation to calculate total wealth.14