Using simple moving average in Equity
A shorter term MA would be used for short term changes in price whilst a long term MA would be used for longer term movements in price.  A 200 day SMA is widely used to determine the trend of the stock, simply a cross above the 200 day SMA would mean the stock may be entering an uptrend and a cross below that the price may be entering a downtrend. If the price is continuosly going above and below in a short period of time it is usually range trading. Then there are EMAs (Expodential Moving Averages) and WMAs (weighted moving averages) which give more emphasis to the latest price data than the earlier price data in the period chosen compared to a SMA. MAs can be used in many different ways, too many to list all here. The best way to learn about them is to read some TA books and articles about them, then choose a couple of strategies where you can use them in combination with a couple of other indicators that are complimentary with each other. One of the most obvious uses of SMAs is the detection of a trend reversal. A trend reversal happens when a short term SMA crosses over a longer term SMA.  For example, if a 20 day moving average was, previously, above a 200 day moving average, but has crossed over the 200 day and is currently below the 200 day then the security has performed a 'death cross' and the trend is for lower and lower prices.  Stockcharts.com has excellent 'chart school' for the beginning chart user. They also provide excellent charts.  Here is a link: http://stockcharts.com/school/doku.php?id=chart_school I  like to use a 20 day SMA, a 200 day SMA, and a 21 day EMA.
"There is no formula that can be applied to most variations of the problem you pose.  The reason is that there is no simple, fixed relationship between the two time periods involved: the time interval for successive payments, and the time period for successive interest compounding. Suppose you have daily compounding and you want to make weekly payments (A case that can be handled).  Say the quoted rate is  4.2% per year, compounded daily Then the rate per day is 4.2/365, or 0.0115068 % So, in one week, a debt would grow through seven compoundings.  A debt of $1 would grow to 1 * (1+.000225068)^7, or 1.000805754 So, the equivalent interest rate for weekly compounding is 0.0805754% Now you have weekly compounding, and weekly payments, so the standard annuity formulas apply. The problem lies in that number ""7"", the number of days in a week.  But if you were trying to handle daily / monthly, or weekly / quarterly, what value would you use? In such cases, the most practical method is to convert any compounding rate to a daily compounding rate, and use a spreadsheet to handle the irregularly spaced payments." I use two measures to define investment risk: What's the longest period of time over which this investment has had negative returns? What's the worst-case fall in the value of this investment (peak to trough)? I find that the former works best for long-term investments, like retirement. As a concrete example, I have most of my retirement money in equity, since the Sensex has had zero returns over as long as a decade. Since my investment time-frame is longer, equity is risk-free, by this measure. For short-term investments, like money put aside to buy a car next year, the second measure works better. For this purpose, I might choose a debt fund that isn't the safest, and has had a worst-case 8% loss over the past decade. I can afford that loss, putting in more money from my pocket to buy the car, if needed. So, I might choose this fund for this purpose, taking a slight risk to earn higher return. In any case, how much money I need for a car can only be a rough guess, so having 8% less than originally planned may turn out to be enough. Or it may turn out that the entire amount originally planned for is insufficient, in which case a further 8% shortfall may not be a big deal. These two measures I've defined are simple to explain and understand, unlike academic stuff like beta, standard deviation, information ratio or other mumbo-jumbo. And they are simple to apply to a practical problem, as I've illustrated with the two examples above. On the other hand, if someone tells me that the standard deviation of a mutual fund is 15%, I'll have no idea what that means, or how to apply that to my financial situation. All this suffers from the problem of being limited to historical data, and the future may not be like the past. But that affects any risk statistic, and you can't do better unless you have a time machine. In my original question, I  was wondering if there was a mathematical convention to help in deciding on whether an equity offering OR debt offering would be a better choice. I should have clarified better in the question, I used Vs. which may have made it unclear. I can think of a few simple and quick techniques for timing the market over the long term, and they can be used individually or in combination with each other. There are also some additional techniques to give early warning of possible turns in the market. The first is using a Moving Average (MA) as an indication of when to sell. Simply if the price closes below the MA it is time to sell. Obviously if the period you are looking at is long term you would probably use a weekly or even monthly chart and use a relatively large period MA such as a 50 week or 100 week moving average. The longer the period the more the MA will lag behind the price but the less false signals and whipsawing there will be. As we are looking long term (5 years +) I would use a weekly chart with a 100 week Exponential MA. The second technique is using a Rate Of Change (ROC) Indicator, which is a momentum indicator. The idea for timing the markets in the long term is to buy when the indicator crosses above the zero line and sell when it crosses below the zero line. For long term investing I would use a 13 week EMA of the 52 week ROC (the EMA smooths out the ROC indicator to reduce the chance of false signals). The beauty of these two indicators is they can be used effectively together. Below are examples of using these two indicators in combination on the S&P500 and the Australian S&P ASX200 over the past 20 years.  S&P500 1995 to 2015  ASX200 1995 to 2015 If I was investing in an ETF tracking one of these indexes I would use these two indicators together by using the MA as an early warning system and maybe tighten any stop losses I have so that if the market takes a sudden turn downward the majority of my profits would be protected. I would then use the ROC Indicator to sell out completely out of the ETF when it crosses below zero or to buy back in when the ROC moves back above zero. As you can see in both charts the two indicators would have kept you out of the market during the worst of the downfalls in 2000 and 2008 for the S&P500 and 2008 for the ASX200. If there is a false signal that gets you out of the market you can quite easily get back in if the indicator goes back above zero. Using these indicators you would have gotten into the market 3 times and out of it twice for the S&P500 over a 20 year period. For the ASX200 you would have gone in 6 times and out 5 times, also over a 20 year period. For individual shares I would use the ROC indicator over the main index the shares belong to, to give an indication of when to be buying individual stocks and when to tighten stop losses and stay on the sidelines. My philosophy is to buy rising stocks in a rising market and sell falling stocks in a falling market. So if the ROC indicator is above zero I would be looking to buy fundamentally healthy stocks that are up-trending and place a 20% trailing stop loss on them. If I get stopped out of one stock then I would look to replace it with another as long as the ROC is still above zero. If the ROC indicator crosses below zero I would tighten my trailing stop losses to 5% and not buy any new stocks once I get stopped out. Some additional indicators I would use for individual stock would be trend lines and using the MACD as a momentum indicator. These two indicators can give you further early warning that the stock may be about to reverse from its current trend, so you can tighten your stop loss even if the ROC is still above zero. Here is an example chart to explain:  GEM.AX 3 Year Weekly Chart Basically if the price closes below the trend line it may be time to close out the position or at the very least tighten up your trailing stop loss to 5%. If the price breaks below an established uptrend line it may well be the end of the uptrend. The definition of an uptrend is higher highs and higher lows. As GEM has broken below the uptrend line and has maid a lower low, all that is needed to confirm the uptrend is over is a lower high. But months before the price broke below the uptrend line, the MACD momentum indicator was showing bearish divergence between it and the price. In early September 2014 the price made a higher high but the MACD made a lower high. This is called a bearish divergence and is an early warning signal that the momentum in the uptrend is weakening and the trend could be reversing soon. Notice I said could and not would. In this situation I would reduce my trailing stop to 10% and keep a watchful eye on this stock over the coming months. There are many other indicators that could be used as signals or as early warnings, but I thought I would talk about some of my favourites and ones I use on a daily and weekly basis. If you were to employ any of these techniques into your investing or trading it may take a little while to learn about them properly and to implement them into your trading plan, but once you have done that you would only need to spend 1 to 2 hours per week managing your portfolio if trading long-term or about 1 hour per nigh (after market close) if trading more medium term. "Below I will try to explain two most common Binomial Option Pricing Models (BOPM) used. First of all, BOPM splits time to expiry into N equal sub-periods and assumes that in each period the underlying security price may rise or fall by a known proportion, so the value of an option in any sub-period is a function of its possible values in the following sub period. Therefore the current value of an option is found by working backwards from expiry date through sub-periods to current time. There is not enough information in the question from your textbook so we may assume that what you are asked to do is to find a value of a call option using just a Single Period BOPM. Here are two ways of doing this: First of all let's summarize your information: Current Share Price (Vs) = $70 Strike or exercise price (X) = $60 Risk-free rate (r) = 5.5% or 0.055 Time to maturity (t) = 12 months Downward movement in share price for the period (d) = $65 / $70 = 0.928571429 Upward movement in share price for the period (u) = 1/d = 1/0.928571429 = 1.076923077 ""u"" can be translated to $ multiplying by Vs => 1.076923077 * $70 = $75.38 which is the maximum probable share price in 12 months time. If you need more clarification here - the minimum and maximum future share prices are calculated from stocks past volatility which is a measure of risk. But because your textbook question does not seem to be asking this - you probably don't have to bother too much about it yet. Intrinsic Value: Just in case someone reading this is unclear - the Value of an option on maturity is the difference between the exercise (strike) price and the value of a share at the time of the option maturity. This is also called an intrinsic value.  Note that American Option can be exercised prior to it's maturity in this case the intrinsic value it simply the diference between strike price and the underlying share price at the time of an exercise. But the Value of an option at period 0 (also called option price) is a price you would normally pay in order to buy it. So, say, with a strike of $60 and Share Price of $70 the intrinsic value is $10, whereas if Share Price was $50 the intrinsic value would be $0. The option price or the value of a call option in both cases would be fixed.  So we also need to find intrinsic option values when price falls to the lowest probable and rises to the maximum probable (Vcd and Vcu respectively) (Vcd) = $65-$60 = $5 (remember if Strike was $70 then Vcd would be $0 because nobody would exercise an option that is out of the money) (Vcu) = $75.38-$60 = $15.38 1. Setting up a hedge ratio:  h = Vs*(u-d)/(Vcu-Vcd) h = 70*(1.076923077-0.928571429)/(15.38-5) = 1 That means we have to write (sell) 1 option for each share purchased in order to hedge the risks. You can make a simple calculation to check this, but I'm not going to go into too much detail here as the equestion is not about hedging. Because this position is risk-free in equilibrium it should pay a risk-free rate (5.5%). Then, the formula to price an option (Vc) using the hedging approach is: (Vs-hVc)(e^(rt))=(Vsu-hVcu) Where (Vc) is the value of the call option, (h) is the hedge ratio, (Vs) - Current Share Price, (Vsu) - highest probable share price, (r) - risk-free rate, (t) - time in years, (Vcu) - value of a call option on maturity at the highest probable share price. Therefore solving for (Vc): (70-1*Vc)(e^(0.055*(12/12))) = (75.38-1*15.38) => (70-Vc)*1.056540615 = 60 => 70-Vc = 60/1.056540615 => Vc = 70 - (60/1.056540615)  Which is similar to the formula given in your textbook, so I must assume that using 1+r would be simply a very close approximation of the formula above. Then it is easy to find that Vc = 13.2108911402 ~ $13.21 2. Risk-neutral valuation: Another way to calculate (Vc) is using a risk-neutral approach. We first introduce a variable (p) which is a risk-neutral probability of an increase in share price. p = (e^(r*t)-d)/(u-d) so in your case: p = (1.056540615-0.928571429)/(1.076923077-0.928571429) = 0.862607107 Therefore using (p) the (Vc) would be equal: Vc = [pVcu+(1-p)Vcd]/(e^(rt)) => Vc = [(0.862607107*15.38)+(0.137392893*5)]/1.056540615 => Vc = 13.2071229185 ~ $13.21 As you can see it is very close to the hedging approach. I hope this answers your questions. Also bear in mind that there is much more to the option pricing than this. The most important topics to cover are: Multi-period BOPM Accounting for Dividends Black-Scholes-Merton Option Pricing Model" How you use the metric is super important.   Because it subtracts cash, it does not represent 'value'.  It represents the ongoing financing that will be necessary if both the equity plus debt is bought by one person, who then pays himself a dividend with that free cash.   So if you are Private Equity, this measures your net investment at t=0.5, not the price you pay at t=0.  If you are a retail investor, who a) won't be buying the debt, b) won't have any control over things like tax jurisdictions, c) won't be receiving any cash dividend, etc etc .... the metric is pointless. "Generally if you are using FIFO (first in, first out) accounting, you will need to match the transactions based on the number of shares. In your example, at the beginning of day 6, you had two lots of shares, 100 @ 50 and 10 @ 52.  On that day you sold 50 shares, and using FIFO, you sold 50 shares of the first lot.  This leaves you with 50 @ 50 and 10 @ 52, and a taxable capital gain on the 50 shares you sold. Note that commissions incurred buying the shares increase your basis, and commissions incurred selling the shares decrease your proceeds.  So if you spent $10 per trade, your basis on the 100 @ 50 lot was $5010, and the proceeds on your 50 @ 60 sale were $2990.  In this example you sold half of the lot, so your basis for the sale was half of $5010 or $2505, so your capital gain is $2990 - 2505 = $485. The sales you describe are also ""wash sales"", in that you sold stock and bought back an equivalent stock within 30 days.  Generally this is only relevant if one of the sales was at a loss but you will need to account for this in your code.  You can look up the definition of wash sale, it starts to get complex. If you are writing code to handle this in any generic situation you will also have to handle stock splits, spin-offs, mergers, etc. which change the number of shares you own and their cost basis.  I have implemented this myself and I have written about 25-30 custom routines, one for each kind of transaction that I've encountered.  The structure of these deals is limited only by the imagination of investment bankers so I think it is impossible to write a single generic algorithm that handles them all, instead I have a framework that I update each quarter as new transactions occur." In addition to the answer from CQM, let me answer your 'am I missing anything?' question. Then I'll talk about how your approach of simplifying this is making it both harder and easier for you. Last I'll show what my model for this would look like, but if you aren't capable of stacking this up yourself, then you REALLY shouldn't be borrowing 10,000 to try to make money on the margin. Am I missing anything? YES. You're forgetting (1) taxes, specifically income tax, and (2) sales commissions//transaction fees.  On the first: You have not considered anything in your financial model for taxes. You should include at least 25% of your expected returns going to taxes, because anything that you buy... and then sell within 12 months... is taxed as income. Not capital gains. On the second: you will incur sales commissions and/or transaction fees depending on the brokerage you are using for your plan. These tend to vary widely, but I would expect to spend at least $25 per sale. So if I were building out this model I would think that your break-even would have to at least cover: monthly interest + monthly principal payment income tax when sold commissions and broker's fees every time you sell holdings On over-simplifying: You have the right idea with thinking about both interest and principal in trying to sketch this out. But as I mentioned above, you're making this both harder and easier for yourself. You are making it harder because you are doing the math wrong. The actual payment for this loan (assuming it is a normal loan) can be found most easily with the PMT function in Excel: =PMT(rate,NPER,PV,FV)... =PMT(.003, 24, -10000, 0). That returns a monthly payment  (of principal + interest) of 432.47.  So you actually are over-calculating the payment by $14/month with your ballpark approach. However, you didn't actually have all the factors in the model to begin with, so that doesn't matter much.  You are making it artificially easier because you have not thought about the impact of repaying principal. What I mean is this--in your question you indicate:  I'm guessing the necessary profit is just the total interest on this loan = 0.30%($10000)(24) = $720 USD ? So I'll break even on this loan - if and only if - I make $720 from stocks over 24 months (so the rate of return is 720/(10000 + 720) = 6.716%). This sounds great-- all you need is a 6.716% total return across two years. But, assuming this is a normal loan and not an 'interest-only' loan, you have to get rid of your capital a little bit at a time to pay back the loan. In essence, you will pay back 1/3 of your principal the first year... and then you have to keep making the same Fixed interest + principal payments out of a smaller base of capital.  So for the first few months you can cover the interest easily, but by the end you have to be making phenomenal returns to cover it.  Here is how I would build a model for it (I actually did... and your breakeven is about 1.019% per month. At that outstanding 12.228% annual return you would be earning a whopping $4.) At least as far as the variables are concerned, you need to be considering: Your current capital balance (because month 1 you may have $10,000 but month 2 you have just 9,619 after paying back some principal).  Your rate of return (if you do this in Excel you can play with it some, but you should save the time and just invest somewhere else.) Your actual return that month (rate of return * existing capital balance).  Loan payment = 432 for the parameters you gave earlier.  Income tax = (Actual Return) * (.25). With this kind of loan, you're not actually making enough to preserve the 10,000 capital and you're selling everything you've gained each month.  Commission = ($25 per month) ... assuming that covers your trade fees and broker commissions. I guarantee you that this is not the deal breaker in the model, so don't get excited if you think I'm over-estimating this and you realize that Scottrade or somewhere will let you have trades at $7.95 each.   Monthly ending balance == next month's starting capital balance.  Stack it all up in Excel for 24 months and see for yourself if you like. The key thing you left out is that you're repaying each month out of capital that you'd like to use to invest with. This makes you need much higher returns.  Even if your initial description wasn't clear and this is an interest-only loan, you're still looking at a rate of about 7.6% annually that you need to hit in order to just break even on the costs of holding the loan and transferring your gains into cash. "Edited: Pub 550 says 30 days before or after so the example is ok - but still a gain by average share basis.  On sale your basis is likely defaulted to ""average price"" (in the example 9.67 so there was a gain selling at 10), but can be named shares at your election to your brokerage,  and supported by record keeping. A Pub 550 wash might be buy 2000 @ 10 with basis 20000, sell 1000 @9 (nominally a loss of 1000 for now and remaining basis 10000), buy 1000 @ 8 within 30 days.   Because of the wash sale rule the basis is 10000+8000 paid + 1000 disallowed loss from wash sale with a final position of 2000 shares at 19000 basis.  I think I have the link at the example:  http://www.irs.gov/publications/p550/ch04.html#en_US_2014_publink100010601" The Gordon equation does not use inflation-adjusted numbers. It uses nominal returns/dividends and growth rates. It really says nothing anyone would not already know.  Everyone knows that your total return equals the sum of the income return plus capital gains.   Gordon simply assumes (perfectly validly) that capital gains will be driven by the growth of earnings, and that the dividends paid will likewise increase at the same rate. So he used the 'dividend growth rate' as a proxy for the 'earnings growth rate' or 'capital gains rate'. You cannot use inflation-removed estimates of equity rates of return because those returns do not change with inflation.  If anything they move in opposite directions.  Eg in the 1970's inflation the high market rates caused people to discount equity values at larger rates --- driving their values down -- creating losses. Quick and dirty paper but pretty interesting.. I'm not in Portfolio Management but I probably would have ended up at the modal number as well.   I don't know the subject deeply enough to answer my own question, but is the bias always toward underestimation of variance? Or is that a complex of the way the problem was set up?   Another question I have for those in investment management; Would this impact asset allocation? Thank you very much for this thoughtful response.  In my opinion the judges care more about the why behind your valuation rather than a how.  Anyone can use a formula, but it takes so much more to understand why to use the formula.    Personally, the 'why' is going to be the toughest part for me understand and wrap my head around.  Once again thank you for the advice and the tip. I have asked myself this exact same question many times. The analysis would be simple if you invested all your money in a single day, but I did not and therefore I would need to convert your cash transactions into Index fund buys/sells. I got tired of trying to do this using Yahoo's data and excel so I built a website in my spare time. I humbly suggest you try my website out in the hopes that it helps you perform this computation: http://www.amibeatingthemarket.com/ If annualized rate of return is what you are looking for, using a tool would make it a lot easier.   In the post I've also explained how to use the spreadsheet.   Hope this helps. As BrenBarn stated, tracking fractional transactions beyond 8 decimal places makes no sense in the context of standard stock and mutual fund transactions.  This is because even for the most expensive equities, those fractional shares would still not be worth whole cent amounts, even for account balances in the hundreds of thousands of dollars. One important thing to remember is that when dealing with equities the total cost, number of shares, and share price are all 3 components of the same value.  Thus if you take 2 of those values, you can always calculate the third: (price * shares = cost, cost / price = shares, etc).  What you're seeing in your account (9 decimal places) is probably the result of dividing uneven values (such as $9.37 invested in a commodity which trades for $235.11, results in 0.03985368550891072264046616477394 shares).  Most brokerages will round this value off somewhere, yours just happens to include more decimal places than your financial software allows. Since your brokerage is the one who has the definitive total for your account balance, the only real solution is to round up or down, whichever keeps your total balance in the software in line with the balance shown online.