How can I calculate total return of stock with partial sale?
If you just want to know total return, either as dollars or a percentage, just add up the total amount spent on buys and compare this to current value plus money received on sales. In this case, you spent (310 x $3.15 + $19.95) + (277 x $3.54 + $19.95). So your total investment is ... calculator please ... $1996.98. You received 200 x $4.75 on the sale minus the $19.95 = $930.05. The present value of your remaining shares is 387 x $6.06 = $2345.22. So you have realized plus unrealized value of $2345.22 + $930.05 = $3275.27. Assuming I didn't mix up numbers or make an arithmetic mistake, your dollar gain is $3275.27 - $1996.98 = $1278.29, which comes to 1278.29 / 1996.98 = 64%. If you want to know percentage gain as an annual rate, we'd have to know buy and sell dates, and with multiple buys and sells the calculation gets messier. You have only sold 200 shares for $4.75 from those bought for $3.15. So your profit on those 200 shares is $1.60 per share or $320 or 51%. From that you have 110 shares left that cost you $3.15 and 277 shares that cost you $3.54. So the total cost of your remaining shares is $1,327.08 (110 x $3.15 + 277 x $3.54). So your remaining shares have a average cost of $3.429 per share ($1,327.08/387). We don't know what the current share price is as you haven't provided it, nor do we know what the company is, so lets say that the current price is $5 (or that you sell the remaining 387 shares for $5 per share). Then the profit on these 387 shares would be $1.571 per share or $607.92 or 46%. Your total profit would then be $320 + $ 607.92 = $927.92 or 47% (note that this profit neglects any brokerage or other fees, as you have not provided any). Edit due to new info. provided in question With the current share price at $6.06 then the profit on these 387 shares would be $2.631 per share or $1018.20 or 77%. Your total profit would then be $320 + $1018.20 = $1338.20 or 75% (note that this profit neglects any brokerage or other fees, as you have not provided any). "Treat each position or partial position as a separate LOT. Each time you open a position, a new lot of shares is created. If you sell the whole position, then the lot is closed. Done. But if you sell a partial quantity, you need to create a new lot. Split the original lot into two. The quantities in each are the amount sold, and the amount remaining. If you were to then buy a few more shares, create a third lot. If you then sell the entire position, you'll be closing out all the remaining lots. This allows you to track each buy/sell pairing. For each lot, simply calculate return based on cost and proceeds. You can't derive an annualized number for ALL the lots as a group, because there's no common timeframe that they share. If you wish to calculate your return over time on the whole series of trades, consider using TWIRR. It treats these positions, plus the cash they represent, as a whole portfolio. See my post in this thread: How can I calculate a ""running"" return using XIRR in a spreadsheet?" There are many ways to calculate the return, and every way will give you a different results in terms of a percentage-value. One way to always get something meaningful - count the cash. You had 977 (+ 31) and in the end you have 1.370, which means you have earned 363 dollars. But what is your return in terms of percentage? One way to look at it, is by pretending that it is a fund in which you invest 1 dollar. What is the fund worth in the beginning and in the end? The tricky part in your example is, you injected new capital into the equation. Initially you invested 977 dollars which later, in the second period became worth 1.473. You then sold off 200 shares for 950 dollars. Remember your portfolio is still worth 1.473, split between 950 in cash and 523 in Shares. So far so good - still easy to calculate return (1.473 / 977 -1 = 50.8% return). Now you buy share for 981 dollars, but you only had 950 in cash? We now need to consider 2 scenarios. Either you (or someone else) injected 31 dollars into the fund - or you actually had the 31 dollars in the fund to begin with. If you already had the cash in the fund to begin with, your initial investment is 1.008 and not 977 (977 in shares and 31 in cash). In the end the value of the fund is 1.370, which means your return is 1.370 / 1.007 = 36%. Consider if the 31 dollars was paid in to the fund by someone other than you. You will then need to recalculate how much you each own of the fund. Just before the injection, the fund was worth 950 in cash and 387 in stock (310 - 200 = 110 x 3.54) = 1.339 dollars - then 31 dollars are injected, bringing the value of the fund up to 1.370. The ownership of the fund is split with 1.339 / 1.370 = 97.8% of the value for the old capital and 2.2% for the new capital. If the value of the fund was to change from here, you could calculate the return for each investor individually by applying their share of the funds value respective to their investment. Because the value of the fund has not changed since the last period (bullet 3), the return on the original investment is (977 / 1.339 - 1 = 37.2%) and the return on the new capital is (31 / 31 = 0%). If you (and not someone else) injected the 31 dollar into the fund, you will need to calculate the weight of each share of capital in each period and get the average return for each period to get to a total return. In this specific case you will still get 37.2% return - but it gets even more comlex for each time you inject new capital.
"This turned out be a lot longer than I expected.  So, here's the overview. Despite the presence of asset allocation calculators and what not, this is a subjective matter.  Only you know how much risk you are willing to take.  You seem to be aware of one rule of thumb, namely that with a longer investing horizon you can stand to take on more risk.  However, how much risk you should take is subject to your own risk aversion.  Honestly, the best way to answer your questions is to educate yourself about the individual topics.  There are just too many variables to provide neat, concise answers to such a broad question.  There are no easy ways around this.  You should not blindly rely on the opinions of others, but rather use your own judgment to asses their advice. Some of the links I provide in the main text: S&P 500: Total and Inflation-Adjusted Historical Returns 10-year index fund returns The Motley Fool Risk aversion Disclaimer: These are the opinions of an enthusiastic amateur.  Why should I invest 20% in domestic large cap and 10% in developing markets instead of 10% in domestic large cap and 20% in developing markets? Should I invest in REITs? Why or why not?  Simply put, developing markets are very risky.  Even if you have a long investment horizon, you should pace yourself and not take on too much risk.  How much is ""too much"" is ultimately subjective.  Specific to why 10% in developing vs 20% in large cap, it is probably because 10% seems like a reasonable amount of your total portfolio to gamble.  Another way to look at this is to consider that 10% as gone, because it is invested in very risky markets.  So, if you're willing to take a 20% haircut, then by all means do that.  However, realize that you may be throwing 1/5 of your money out the window. Meanwhile, REITs can be quite risky as investing in the real estate market itself can be quite risky.  One reason is that the assets are very much fixed in place and thus can not be liquidated in the same way as other assets.  Thus, you are subject to the vicissitudes of a relatively small market.  Another issue is the large capital outlays required for most commercial building projects, thus typically requiring quite a bit of credit and risk.  Another way to put it: Donald Trump made his name in real estate, but it was (and still is) a very bumpy ride.  Yet another way to put it: you have to build it before they will come and there is no guarantee that they will like what you built. What mutual funds or index funds should I investigate to implement these strategies?  I would generally avoid actively managed mutual funds, due to the expenses.  They can seriously eat into the returns.  There is a reason that the most mutual funds compare themselves to the Lipper average instead of something like the S&P 500.  All of those costs involved in managing a mutual fund (teams of people and trading costs) tend to weigh down on them quite heavily.  As the Motley Fool expounded on years ago, if you can not do better than the S&P 500, you should save yourself the headaches and simply invest in an S&P 500 index fund. That said, depending on your skill (and luck) picking stocks (or even funds), you may very well have been able to beat the S&P 500 over the past 10 years.  Of course, you may have also done a whole lot worse.  This article discusses the performance of the S&P 500 over the past 60 years.  As you can see, the past 10 years have been a very bumpy ride yielding in a negative return.  Again, keep in mind that you could have done much worse with other investments. That site, Simple Stock Investing may be a good place to start educating yourself.  I am not familiar with the site, so do not take this as an endorsement.  A quick once-over of the material on the site leads me to believe that it may provide a good bit of information in readily digestible forms.  The Motley Fool was a favorite site of mine in the past for the individual investor.  However, they seem to have turned to the dark side, charging for much of their advice.  That said, it may still be a good place to get started.  You may also decide that it is worth paying for their advice. This blog post, though dated, compares some Vanguard index funds and is a light introduction into the contrarian view of investing.  Simply put, this view holds that one should not be a lemming following the crowd, rather one should do the opposite of what everyone else is doing.  One strong argument in favor of this view is the fact that as more people pile onto an investing strategy or into a particular market, the yields thin out and the risk of a correction (i.e. a downturn) increases.   In the worst case, this leads to a bubble, which corrects itself suddenly (or ""pops"" thus the term ""bubble"") leading to quite a bit of pain for the unprepared participants.  An unprepared participant is one who is not hedged properly.  Basically, this means they were not invested in other markets/strategies that would increase in yield as a result of the event that caused the bubble to pop.   Note that the recent housing bubble and resulting credit crunch beat quite heavily on the both the stock and bond markets.  So, the easy hedge for stocks being bonds did not necessarily work out so well.  This makes sense, as the housing bubble burst due to concerns over easy credit. Unfortunately, I don't have any good resources on hand that may provide starting points or discuss the various investing strategies.  I must admit that I am turning my interests back to investing after a hiatus.   As I stated, I used to really like the Motley Fool, but now I am somewhat suspicious of them.  The main reason is the fact that as they were exploring alternatives to advertising driven revenue for their site, they promised to always have free resources available for those unwilling to pay for their advice.  A cursory review of their site does show a decent amount of general investing information, so take these words with a grain of salt.  (Another reason I am suspicious of them is the fact that they ""spammed"" me with lots of enticements to pay for their advice which seemed just like the type of advice they spoke against.) Anyway, time to put the soapbox away.  As I do that though, I should explain the reason for this soapboxing.  Simply put, investing is a risky endeavor, any way you slice it.  You can never eliminate risk, you can only hope to reduce it to an acceptable level.  What is acceptable is subject to your situation and to the magnitude of your risk aversion.  Ultimately, it is rather subjective and you should not blindly follow someone else's opinion (professional or otherwise).  Point being, use your judgment to evaluate anything you read about investing.   If it sounds too good to be true, it probably is.  If someone purports to have some strategy for guaranteed (steady) returns, be very suspicious of it.  (Read up on the Bernard Madoff scandal.)  If someone is putting on a heavy sales pitch, be weary.  Be especially suspicious of anyone asking you to pay for their advice before giving you any solid understanding of their strategy.  Sure, many people want to get paid for their advice in some way (in fact, I am getting ""paid"" with reputation on this site).  However, if they take the sketchy approach of a slimy salesmen, they are likely making more money from selling their strategy, than they are from the advice itself.  Most likely, if they were getting outsized returns from their strategy they would keep quiet about it and continue using it themselves.  As stated before, the more people pile onto a strategy, the smaller the returns.  The typical model for selling is to make money from the sale.  When the item being sold is an intangible good, your risk as a buyer increases. You may wonder why I have written at length without much discussion of asset allocation.  One reason is that I am still a relative neophyte and have a mostly high level understanding of the various strategies.  While I feel confident enough in my understanding for my own purposes, I do not necessarily feel confident creating an asset allocation strategy for someone else.  The more important reason is that this is a subjective matter with a lot of variables to consider.  If you want a quick and simple answer, I am afraid you will be disappointed.  The best approach is to educate yourself and make these decisions for yourself.  Hence, my attempt to educate you as best as I can at this point in time. Personally, I suggest you do what I did.  Start reading the Wall Street Journal every day. (An acceptable substitute may be the business section of the New York Times.)  At first you will be overwhelmed with information, but in the long run it will pay off.  Another good piece of advice is to be patient and not rush into investing.   If you are in a hurry to determine how you should invest in a 401(k) or other such investment vehicle due to a desire to take advantage of an employer's matching funds, then I would place my money in an S&P 500 index fund.  I would also explore placing some of that money into broad index funds from other regions of the globe.  The reason for broad index funds is to provide some protection from the normal fluctuations and to reduce the risk of a sudden downturn causing you a lot pain while you determine the best approach for yourself.  In this scenario, think more about capital preservation and hedging against inflation then about ""beating"" the market." "Wow, this analysis really surprised me. Very complete and useful, but i think my teacher request was easier. He just said: ""Try to build a diversified portfolio. Then try to add a commodity (like silver or gold) and understand how the risk vary introducing an asset like this."" So, i'm basically making a stocks portfolio and i'm calculating its expected return and risk. (for example 40%FB, 10%JNJ, 20%GS, 10%F and 20%MCD) then i'm adding GLD (so now i have something like 20%FB, 10%JNJ, 10%GS, 10%F and 20%MCD 30%GLD) and i'm actually making an excel spreadsheet where i calculate all the: -Expected returns -St Deviation -Covariance  At the end i compare the returns and the risks on the 2 different portfolios." What's the present value of using the payment plan? In all common sense the present value of a loan is the value that you can pay in the present to avoid taking a loan, which in this case is the lump sum payment of $2495.  That rather supposes the question is a trick, providing irrelevant information about the stock market. However, if some strange interpretation is required which ignores the lump sum and wants to know how much you need in the present to pay the loan while being able to make 8% on the stock market that can be done. I will initially assume that since the lender's APR works out about 9.6% per month that the 8% from the stock market is also per month, but will also calculate for 8% annual effective and an 8% annual nominal rate. The calculation If you have $x in hand (present value) and it is exactly enough to take the loan while investing in the stock market, the value in successive months is $x plus the market return less the loan payment.  In the third month the loan is paid down so the balance is zero. I.e. So the present value of using the payment plan while investing is $2569.37. You would need $2569.37 to cover the loan while investing, which is more than the $2495 lump sum payment requires.  Therefore, it would be advisable to make the lump sum payment because it is less expensive: If you have $2569.37 in hand it would be best to pay the lump sum and invest the remaining $74.37 in the stock market.  Otherwise you invest $2569.37 (initially), pay the loan and end up with $0 in three months. One might ask, what rate of return would the stock market need to yield to make it worth taking the loan? The APR proposed by the loan can be calculated.   The present value of a loan is equal to the sum of the payments discounted to present value.  I.e. with  ∴ by induction  So by comparing the $2495 lump sum payment with $997 over 3 x monthly instalments the interest rate implied by the loan can be found. Solving for r If you could obtain 9.64431% per month on the stock market the $x cash in hand required would be calculated by This is equal to the lump sum payment, so the calculated interest is comparable to the stock market rate of return.  If you could gain more than 9.64431% per month on the stock market it would be better to invest and take the loan. Recurrence Form Solving the recurrence form shows the calculation is equivalent to the loan formula, e.g. becomes v[m + 1] = (1 + y) v[m] - p where v[0] = pv where In the final month v[final] = 0, i.e. when m = 3 Compare with the earlier loan formula: s = (d - d (1 + r)^-n) / r They are exactly equivalent, which is quite interesting, (because it wasn't immediately obvious to me that what the lender charges is the mirror opposite of what you gain by investing). The present value can be now be calculated using the formula. Still assuming the 8% stock market return is per month. If the stock market yield is 8% per annum effective rate and if it is given as a nominal annual yield, 8% compounded monthly You should have drafted a contract of purchase that stipulated out equity stake in the home based of his down payment and yours, along with future monthly payments.  But morally, if the house sells, yielding 100,000 profit (after fees/taxes/etc), you should get ( To Calculate Your Cut: (20,000 + Your Total Mortgage Payments Applied to Principle) / (1,900 + His Total Mortgage Payments Applied to Principle Only) * Profit on Sale of House After All Fees = Your Cut His would be: (1,900 + His Total Mortgage Payments Applied to Principle Only) / (20,000 + Your Total Mortgage Payments Applied to Principle) * Profit on Sale of House After All Fees = His Cut You'd then take mortgage payment totals for each; and calculate the payments made towards interest; and claim the correct amount each of you paid on payments for the mortgage interest deduction when you file your taxes. Although, depending on how the loan is written, the banks may issue 1099s which dont reflect actual payments made... Talk to an accountant. Equal sized gains and losses in alternating years would lead to an   unjust positive tax. On the contrary. If I can take my gains at the long term rate (15%) in even years, but take losses in odd years, up to $3000, or let them offset short term gains at ordinary rate, I've just gamed the system.  What is the purpose of the wash sale rule? Respectfully, we here can do a fine job of explaining how a bit of tax code works. And we can suggest the implication of those code bits. But, I suspect that it's not easy to explain the history of particular rules. For wash sale, the simple intent is to not let someone take a loss without actually selling the stock for a time. You'd be right to say the +/- 30 days is arbitrary.  I'd ask you to keep 2 things in mind if you continue to frequent this board - With your numbers, look at it this way - You borrowed $50. When the stock is $100, you are at 50% margin.  What's most important, is that there's margin interest charged, so the amount owed will increase regardless of the stock price. When calculating your return or loss, the interest has to be accounted for or your numbers will be wrong. For a small investor, margin rates can run high, and often, will offset much of your potential gain. What good is a $100 gain if you paid $125 in margin interest? The price-earnings ratio is calculated as the market value per share divided by the earnings per share over the past 12 months. In your example, you state that the company earned $0.35 over the past quarter. That is insufficient to calculate the price-earnings ratio, and probably why the PE is just given as 20. So, if you have transcribed the formula correctly, the calculation given the numbers in your example would be: 0.35 * 4 * 20 = $28.00 As to CVRR, I'm not sure your PE is correct. According to Yahoo, the PE for CVRR is 3.92 at the time of writing, not 10.54. Using the formula above, this would lead to: 2.3 * 4 * 3.92 = $36.06 That stock has a 52-week high of $35.98, so $36.06 is not laughably unrealistic. I'm more than a little dubious of the validity of that formula, however, and urge you not to base your investing decisions on it. "Finding the ""optimal"" solution (and even defining what optimal is) would probably take a lot of searching of all the possible combinations of stocks you could buy, given that you can't buy fractional shares. But I'd guess that a simple ""greedy"" algorithm should get you close enough. For any given portfolio state, look at which stock is furthest below the target size - e.g. in your example, S3 is 3.5% away whereas S1 is only 3.1% away and S2 is over-sized. Then decided to buy one stock of S3, recalculate the current proportions, and repeat until you can't buy more stocks because you've invested all the money. If you have to pay a transaction fee for each kind of stock you purchase you might want to calculate this in larger lot sizes or just avoid making really small purchases."