Upcoming SlideShare
×

# [Trading e books] how to win the stock market game

1,673 views
1,578 views

Published on

Published in: Education
1 Like
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

Views
Total views
1,673
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
53
0
Likes
1
Embeds 0
No embeds

No notes for slide

### [Trading e books] how to win the stock market game

9. 9. 9 These data can be presented graphically. Dependence of weekly returns on the SP 500 change for hypothetical strategy Using any graphical program you can plot the dependence of weekly returns on the SP500 change and using a linear fitting program draw the fitting line as in shown in Figure. Thecorrelation coefficient c is the parameter for quantitative description of deviations of data pointsfrom the fitting line. The range of change of c is from -1 to +1. The larger the scattering of thepoints about the fitting curve the smaller the correlation coefficient. The correlation coefficient is positive when positive change of some parameter (SP 500change in our example) corresponds to positive change of the other parameter (weekly returnsin our case). The equation for calculating the correlation coefficient can be written as where X and Y are some random variable (returns as an example); S are the standarddeviations of the corresponding set of returns; N is the number of points in the data set. For our example the correlation coefficient is equal to 0.71. This correlation is very high.Usually the correlation coefficients are falling in the range (-0.1, 0.2). We have to note that to correctly calculate the correlation coefficients of trading returnsone needs to compare X and Y for the same period of time. If a trader buys and sells stocksevery day he can compare daily returns (calculated for the same days) for different strategies.If a trader buys stocks and sells them in 2-3 days he can consider weekly or monthly returns. Correlation coefficients are very important for the market analysis. Many stocks havevery high correlations. As an example let us present the correlation between one days pricechanges of MSFT and INTC.
10. 10. 10 Correlation between one days price change of INTC and MSFT The presented data are gathered from the 1988 to 1999 year period. The correlationcoefficient c = 0.361, which is very high for one day price change correlation. It reflectssimultaneous buying and selling these stocks by mutual fund traders. Note that correlation depends on time frame. The next Figure shows the correlationbetween ten days (two weeks) price changes of MSFT and INTC. Correlation between ten day price change of INTC and MSFT The ten day price change correlation is slightly weaker than the one day price changecorrelation. The calculation correlation coefficient is equal to 0.327.
11. 11. 11Efficient Trading Portfolio The theory of efficient portfolio was developed by Harry Markowitz in 1952.(H.M.Markowitz, "Portfolio Selection," Journal of Finance, 7, 77 - 91, 1952.) Markowitzconsidered portfolio diversification and showed how an investor can reduce the risk ofinvestment by intelligently dividing investment capital. Let us outline the main ideas of Markowitzs theory and tray to apply this theory totrading portfolio. Consider a simple example. Suppose, you use two trading strategies. Theaverage daily returns of these strategies are equal to R1 and R2. The standard deviations ofthese returns (risks) are s1 and s2. Let q1 and q2 be parts of your capital using thesestrategies.q1 + q2 = 1Problem: Find q1 and q2 to minimize risk of trading.Solution: Using the theory of probabilities one can show that the average daily return for thisportfolio is equal toR = q1*R1 + q2*R2 The squared standard deviation (variance) of the average return can be calculated fromthe equations2 = (q1*s1)2 + (q2*s2)2 + 2*c*q1*s1*q2*s2 where c is the correlation coefficient for the returns R1 and R2. To solve this problem it is good idea to draw the graph R, s for different values of q1. Asan example consider the two strategies described in Section 2. The daily returns (calculatedfrom the growth coefficients) and risks for these strategies are equal toR1 = 1.4% s1 = 5.0%R2 = 1.3% s2 = 11.2 % The correlation coefficient for these returns is equal toc = 0.09 The next figure shows the return-risk plot for different values of q1.
13. 13. 13 We calculated return R and standard deviation s (risk) for various values of q1 - part ofthe capital employed for purchase using the first strategy. The next figure shows the return -risk plot for various values of q1. Return - risk plot for various values of q1 for strategy described in the text You can see that minimal risk is observed when q1 = 0.4, i.e. 40% of trading capitalshould be spend for strategy #1. Let us plot the risk to return ratio as a function of q1. The risk to return ratio as a function of q1 for strategy described in the text You can see that the minimum of the risk to return ratio one can observe when q1 =0.47, not 0.4. At this value of q1 the risk to return ratio is almost 40% less than the ratio in thecase where the whole capital is employed using only one strategy. In our opinion, this is theoptimal distribution of the trading capital between these two strategies. In the table we showthe returns, risks and risk to return ratios for strategy #1, #2 and for efficient trading portfoliowith minimal risk to return ratio. Average return, % Risk, % Risk/Return Strategy #1 3.55 11.6 3.27 Strategy #2 2.94 9.9 3.37 Efficient Portfolio 3.2 8.2 2.5 q1 = 47%
14. 14. 14 One can see that using the optimal distribution of the trading capital slightly reduces theaverage returns and substantially reduces the risk to return ratio. Sometimes a trader encounters the problem of estimating the correlation coefficient fortwo strategies. It happens when a trader buys stocks randomly. It is not possible to construct atable of returns with exact correspondence of returns of the first and the second strategy. Oneday he buys stocks following the first strategy and does not buy stocks following the secondstrategy. In this case the correlation coefficient cannot be calculated using the equation shownabove. This definition is only true for simultaneous stock purchasing. What can we do in thiscase? One solution is to consider a longer period of time, as we mentioned before. However, asimple estimation can be performed even for a short period of time. This problem will beconsidered in the next section.
16. 16. 16 In this example there are only two returns (Jan 3, Jan 10), which can be compared andbe used for calculating the correlation coefficient. Here we will consider the influence of correlation coefficients on the calculation of theefficient portfolio. As an example, consider two trading strategies (#1 and #2) with returns andrisks:R1 = 3.55 % s1 = 11.6 %R2 = 2.94 % s2 = 9.9 % Suppose that the correlation coefficient is unknown. Our practice shows that thecorrelation coefficients are usually small and their absolute values are less than 0.15. Let us consider three cases with c = -0.15, c = 0 and c = 0.15. We calculated returns Rand standard deviations S (risk) for various values of q1 - part of the capital used for purchaseof the first strategy. The next figure shows the risk/return plot as a function of q1 for variousvalues of the correlation coefficient. Return - risk plot for various values of q1 and the correlation coefficients for the strategies described in the text. One can see that the minimum of the graphs are very close to each other. The nexttable shows the results. c q1 R S S/R -0.15 0.55 3.28 7.69 2.35 0 0.56 3.28 8.34 2.57 0.15 0.58 3.29 8.96 2.72 As one might expect, the values of "efficient" returns R are also close to each other, butthe risks S depend on the correlation coefficient substantially. One can observe the lowest riskfor negative values of the correlation coefficient.
18. 18. 18 The probabilities (in %) of 50% drops in the trading capital for different values of average returns and risk-to-return ratios One can see that for risk to return ratios less than 4 the probability of losing 50% of thetrading capital is very small. For risk/return > 5 this probability is high. The probability is higherfor the larger values of the average returns.Conclusion: A trader should avoid strategies with large values of average returns if the risk to returnratios for these strategies are larger than 5.Influence of Commissions We have mentioned that when a trader is losing his capital the situation becomes worseand worse because the influence of the brokerage commissions becomes larger. As an example consider a trading method, which yields 2% return per day andcommissions are equal to 1% of initial trading capital. If the capital drops as much as 50% thencommissions become 2% and the trading system stops working because the average return perday becomes 0%. We have calculated the probabilities of a 50% capital drop for this case for differentvalues of risk to return ratios. To compare the data obtained we have also calculated theprobabilities of 50% capital drop for an average daily return = 1% (no commissions have beenconsidered). For initial trading capital the returns of these strategies are equal but the first strategybecomes worse when the capital becomes smaller than its initial value and becomes betterwhen the capital becomes larger than the initial capital. Mathematically the return can bewritten asR = Ro - commissions/capital * 100%where R is a real return and Ro is a return without commissions. The next figure shows theresults of calculations.
20. 20. 20Distributions of Annual Returns Is everything truly bad if the risk to return ratio is large? No, it is not. For large values ofrisk to return ratios a trader has a chance to be a lucky winner. The larger the risk to returnratio, the broader the distribution of annual returns or annual capital growth.Annual capital growth = (Capital after 1 year) / (Initial Capital) We calculated the distribution of the annual capital growths for the strategy with theaverage daily return = 0.7% and the brokerage commissions = \$20. The initial trading capitalwas supposed = \$5,000. The results of calculations are shown in the next figure for two valuesof the risk to return ratios. Distributions of annual capital growths for the strategy described in the text The average annual capital growths are equal in both cases (3.0 or 200%) but thedistributions are very different. One can see that for a risk to return ratio = 6 the chance of alarge loss of capital is much larger than for the risk to return ratio = 3. However, the chance ofannual gain larger than 10 (> 900%) is much greater. This strategy is good for traders who likerisk and can afford losing the whole capital to have a chance to be a big winner. It is like alottery with a much larger probability of being a winner.When to give up In the previous section we calculated the annual capital growth and supposed that thetrader did not stop trading even when his capital had become less than 50%. This makes senseonly in the case when the influence of brokerage commissions is small even for reduced capitaland the trading strategy is still working well. Let us analyze the strategy of the previous sectionin detail. The brokerage commissions were supposed = \$20, which is 0.4% for the capital =\$5,000 and 0.8% for the capital = \$2,500.
21. 21. 21 So, after a 50% drop the strategy for a small capital becomes unprofitable because theaverage return is equal to 0.7%. For a risk to return ratio = 6 the probability of touching the50% level is equal to 16.5%. After touching the 50% level a trader should give up, switch tomore profitable strategy, or add money for trading. The chance of winning with the amount ofcapital = \$2,500 is very small. The next figure shows the distribution of the annual capital growths after touching the50% level.Distribution of the annual capital growths after touching the 50% level. Initial capital = \$5,000; commissions = \$20; risk/return ratio = 6; average daily return = 0.7% One can see that the chance of losing the entire capital is quite high. The averageannual capital growth after touching the 50% level (\$2,500) is equal to 0.39 or \$1950.Therefore, after touching the 50% level the trader will lose more money by the end of the year. The situation is completely different when the trader started with \$10,000. The nextfigure shows the distribution of the annual capital growths after touching the 50% level in thismore favorable case.Distribution of the annual capital growths after touching the 50% level. Initial capital = \$10,000; commissions = \$20; risk/return ratio = 6; average daily return = 0.7% One can see that there is a good chance of finishing the year with a zero or evenpositive result. At least the chance of retaining more than 50% of the original trading capital ismuch larger than the chance of losing the rest of money by the end of the year. The averageannual capital growth after touching the 50% level is equal to 0.83. Therefore, after touchingthe 50% level the trader will compensate for some losses by the end of the year.
29. 29. 29Problem: Suppose, a trader has \$5,000 to buy stocks and he does not use margin. The brokerageround trip commissions are equal to \$20. The average return per trade (after taking intoaccount the bid-ask spread) is equal to R (%). The returns have distribution with the standarddeviation (risk) s. What is the optimal number of stocks N a trader should buy to minimize therisk to return ratio?Solution: To buy one stock a trader can spend (5000 / N - 10) dollars. The average return R1 perone stock will be equal toR1 = 100% * [(5000 / N - 10) R/100 - 10] / (5000 / N) = 100% * [(5000 - 10N) R/100 - 10N] / 5000 This is also equal to the average return Rav of the entire capital because we considerreturn in %.Rav = R1 One can see that increasing N reduces the average return and this reduction is larger fora larger value of brokerage commissions. The total risk S is decreased by 1/SQRT (N) as wediscussed previously.S = s/SQRT (N) The risk to return ratio can be written asS/R = 5000*s/{SQRT (N)*100% * [(5000 - 10N) R/100 - 10N]} The problem is reduced to the problem of finding the minimum of the function S/R. Thevalue of s does not shift the position of the maximum and for simplicity we can take s = 1. Thefunction S/R is not simple and we will plot the dependence of the ratio S/R for different valuesof N and R. The risk to return ratio as a function of number of stocks
31. 31. 31PART 3Table of Contents 1. Random walk and stop-limit strategy 2. Non-random walk and stop-limit strategy 3. How to make a profit in the non-random market 4. What can be wrong 5. Stops and real tradingRandom walk and stop-limit strategy One of the most popular stock market theories is the random walk model. It is assumedthat for short periods of time stock prices change randomly. So, probabilities of growth anddecline are equal. One of the most important theorems of the random walk model can beformulated for the stock market as: For any initial stock price and for any limit price the probability of hitting the limit priceis equal to 1. From the first point of view making profit is very easy: buy stock, place the limit orderto sell above the stock price and wait. Sooner or later the limit will be touched and you canmake a profit. This is wrong! There is no chance of making any profit in the random market. Youshould remember that the stock price can also touch the level = 0 (or very low price) and thegame is over. To show how to analyze the trading strategies in the random market considerstop-limit strategy. The stop level can be equal to zero, which corresponds to a game withoutany stop. S L_______________|_________|___________|_________________ stop current limit price On the diagram, S and L are the differences between the current stock price and thestop and limit order levels. The simplest strategy is to buy some stock and wait until the stockprice touches the stop or limit levels (prices). If the stop level is touched first - you are a loser. If the stock price touches the limit level - you sell the stock with a profit and you are awinner. It can be shown that for this model the probability of touching the stop level can bewritten asP (S) = L / (S + L) One can find the derivation of this equation in William Fellers book Introduction toProbability Theory and Its Application. The probability of touching the limit level is equal toP (L) = S / (S + L) One can check that P (L) = 1 – P (S). The average return per trade can be written asR = L*P (L) - S*P (S) = 0
32. 32. 32 This strategy gives zero average return in the case of zero commissions. It can beshown that the variance of the returns (the squared standard deviation or "squared risk") isequal tos2 = S * L So, the larger the deviations of the stop or limit order levels from the current stockprice, the larger the risk of this trading strategy. You can consider many other trading strategies but it can be shown that for randomwalk price changes the average returns are always equal to zero for zero transaction costs. Inreal life you will be a loser because of brokerage commissions and bid-ask spreads.Non-random walk and stop-limit strategy The situation changes when the probability of growth is larger than the probability ofdecline. In this case the probability of touching the limit level can be higher than the probabilityof touching the stop level and your average return is positive. Consider a simple case. Suppose that the stock price is equal to \$100 and the price ischanging by one dollar steps. As in the previous section let L and S be the deviations of thelimit and stop orders from the stock price. Denote by p the probability of stock price gain andby q the probability of stock price decline. The sum of these probabilities is equal to 1.p+q=1 The probability of touching the stop level can be written asP (S) = [1 - (p/q)^L] / [1 - (p/q)^(S+L)] The probability of touching the limit level can be calculated fromP (L) = 1 – P (S) The average return can be calculated from the equationR = L*P (L) - S*P (S) What are the optimal limit and stop orders in the case when p is not equal to q? Thenext figure shows the results of calculation of the average returns per trade for various valuesof the stop and limit orders.
33. 33. 33 Average return per trade for stop-limit strategy for two values of the growth probability p. S is the deviation of the stop level from the current stock price in % From this figure one can draw two very important conclusions:- if a trader selects stocks with a growth probability larger than 50% then the average return ispositive and the stop levels must be far away from the current stock price to obtain themaximal return.- if a trader select stocks with a growth probability smaller than 50% then the average return isnegative and the stop levels must be as close as possible to the current stock price to minimizelosses. There is an important theorem for the non-random walk model: if the limit level is equalto infinity (no limit) then the probability of touching the stop level is equal to:P=1 if p <= qP = (q/p)^S if p > q Therefore, if p > q (bullish stock) there is a chance that the stop level will never betouched. This probability is larger for larger S and smaller ratio q/p.How to make a profit in the non-random market It is hard to imagine that all stocks have a probability of growth exactly equal to 50%.Many stocks have a growth probability of 55%, 60% and more. However, the stock marketdoes not grow with a high probability and this means there many stocks with low growthprobabilities 45%, 40% and less. The probabilities depend on technically overbought oroversold conditions, good or bad fundamentals, interest from traders, etc. How can we applystop-limit strategy for this market to obtain a profit?
34. 34. 34 To answer this question, consider a simple case. Suppose that the "market" consists oftwo stocks. One stock has the growth probability p1 = 0.55 and the second stock has thegrowth probability p2 = 0.45. We buy the two stocks using equal amounts of money for eachstock. We also place stop loss orders and place mental limit orders to sell if we see some profit. Denote by S and L the differences between the current stock price and the stop andlimit order levels. The next figure shows the average returns per trade for this strategydepending on the levels of stop and limit orders.The average return as a function of the levels of limit order for various stop loss order levels. Details of this trading strategy are described in the text It is important to note that using stop loss orders which are far away from the currentstock price together with close limit orders provide negative returns. The winning strategy isusing "tight" stops and large limit targets.What can be wrong From the previous section one can conclude that making money in the stock market isquite easy. All you need is to have enough money to buy a dozen of stocks, place stops andlimits and wait for a nice profit. However, the majority of traders are losing money. What iswrong? In the previous section we supposed that stocks have growth probabilities, which arestable. So, if p = 0.55 at the moment of purchase it will be equal to 0.55 even after sharp pricegrowth. This is wrong. One can find a stock with p = 0.55 and even larger but after a couple ofdays this probability usually becomes close to 0.5 or even becomes less then 0.5, which is thereason for price fluctuations. The waiting time when your limit order will be executed can be very long. Many timesyou will sell stocks early with smaller profit.If you select stocks randomly, you will mostly select stocks with growth probabilities close to50%. If we consider the model described in the previous section with p1 = 0.49 and p2 = 0.51then this scheme will not work. Brokerage commissions and bid-ask spreads will eat up yourprofit. What can be done? You need to select stocks with high probabilities of growth andoptimize the stop order levels. In the next section we present the results of computer analysisof the real market to show methods for developing a winning trading strategy.