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.
Simple math. Take the sale proceeds (after trade expenses) and divide by cost. Subtract 1, and this is your return. For example, buy at 80, sell at 100, 100/80 = 1.25, your return is 25%. To annualize this return, multiply by 365 over the days you were in that stock. If the above stock were held for 3 months, you would have an annualized return of 100%.  There's an alternative way to annualize, in the same example above take the days invested and dive into 365, here you get 4. I suggested that 25% x 4 = 100%. Others will ask why I don't say 1.25^4 = 2.44 so the return is 144%/yr. (in other words, compound the return, 1.25x1.25x...) A single day trade, noon to noon the next day returning just 1%, would multiply to 365% over a year, ignoring the fact there are about 250 trading days. But 1.01^365 is 37.78 or a 3678% return. For long periods, the compounding makes sense of course, the 8%/yr I hope to see should double my money in 9 years, not 12, but taking the short term trades and compounding creates odd results of little value. 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. I use the following method. For each stock I hold long term, I have an individual table which records dates, purchases, sales, returns of cash, dividends, and way at the bottom, current value of the holding. Since I am not taking the income, and reinvesting across the portfolio, and XIRR won't take that into account, I build an additional column where I 'gross up' the future value up to today() of that dividend by the portfolio average yield at the date the dividend is received. The grossing up formula is divi*(1+portfolio average return%)^((today-dividend date-suitable delay to reinvest)/365.25) This is equivalent to a complex XMIRR computation but much simpler, and produces very accurate views of return.  The 'weighted combined' XIRR calculated across all holdings then agrees very nearly with the overall portfolio XIRR. I have done this for very along time.  TR1933 Yes, 1933 is my year of birth and still re investing divis! Generally speaking.  1. Take the position size / average daily volume.  2. Multiply that number by 10 or whatever 1/whatever % of volume you think you can execute, ( you can at best acct for 10 percent of traded volume on a day).  3. You now have days until liquidation (x)  4. Take the days until liquidation sample the return over  time x. I.e. if days until liquidation is 10, you would sample 10 day returns.  5. Calculate the distribution characteristics of this window (mean, var, skew, kurt) and calculate VaR based on some confidence.  You can now have a liquidity risk expected loss and a VaR.  If position is on margin don't forget to add the interest cost.  Note: Instead of taking 10 day return, you can take the 10 day VWAP and calculate return between Open and 10 day vwap. "The process of borrowing shares and selling them is called shorting a stock, or ""going short.""  When you use money to buy shares, it is called ""going long."" In general, your strategy of going long and short in the same stock in the same amounts does not gain you anything.  Let's look at your two scenarios to see why. When you start, LOOT is trading at $20 per share.  You purchased 100 shares for $2000, and you borrowed and sold 100 shares for $2000.  You are both long and short in the stock for $2000.  At this point, you have invested $2000, and you got your $2000 back from the short proceeds.  You own and owe 100 shares. Under scenario A, the price goes up to $30 per share.  Your long shares have gone up in value by $1000.  However, you have lost $1000 on your short shares.  Your short is called, and you return your 100 shares, and have to pay interest.  Under this scenario, after it is all done, you have lost whatever the interest charges are. Under scenario B, the prices goes down to $10 per share.  Your long shares have lost $1000 in value.  However, your short has gained $1000 in value, because you can buy the 100 shares for only $1000 and return them, and you are left with the $1000 out of the $2000 you got when you first sold the shorted shares.  However, because your long shares have lost $1000, you still haven't gained anything.  Here again, you have lost whatever the interest charges are. As explained in the Traders Exclusive article that @RonJohn posted in the comments, there are investors that go long and short on the same stock at the same time.  However, this might be done if the investor believes that the stock will go down in a short-term time frame, but up in the long-term time frame.  The investor might buy and hold for the long term, but go short for a brief time while holding the long position. However, that is not what you are suggesting.  Your proposal makes no prediction on what the stock might do in different periods of time.  You are only attempting to hedge your bets.  And it doesn't work.  A long position and a short position are opposites to each other, and no matter which way the stock moves, you'll lose the same amount with one position that you have gained in the other position.  And you'll be out the interest charges from the borrowed shares every time. With your comment, you have stated that your scenario is that you believe that the stock will go up long term, but you also believe that the stock is at a short-term peak and will drop in the near future.  This, however, doesn't really change things much.  Let's look again at your possible scenarios. You believe that the stock is a long-term buy, but for some reason you are guessing that the stock will drop in the short-term.  Under scenario A, you were incorrect about your short-term guess.  And, although you might have been correct about the long-term prospects, you have missed this gain.  You are out the interest charges, and if you still think the stock is headed up over the long term, you'll need to buy back in at a higher price. Under scenario B, it turns out that you were correct about the short-term drop.  You pocket some cash, but there is no guarantee that the stock will rise anytime soon.  Your investment has lost value, and the gain that you made with your short is still tied up in stocks that are currently down. Your strategy does prevent the possibility of the unlimited loss inherent in the short.  However, it also prevents the possibility of the unlimited gain inherent in the long position.    And this is a shame, since you fundamentally believe that the stock is undervalued and is headed up.  You are sabotaging your long-term gains for a chance at a small short-term gain." Thanks for showing me that. I can see it now. I have always used my formula, and even a senior at another company confirmed the way I calculated the returns.   Luckily, I do not work with that manager, and he has his own model, and so do I. But he was pretty cool about it when I asked about his calculations. "(Value of shares+Dividends received)/(Initial investment) would be the typical formula though this is more of a percentage where 1 would indicate that you broke even, assuming no inflation to be factored. No, you don't have to estimate the share price based on revenues as I would question how well did anyone estimate what kind of revenues Facebook, Apple, or Google have had and will have. To estimate the value of shares, I'd likely consider what does my investment strategy use as metrics: Is it discounted cash flow, is it based on earnings, is it something else? There are many ways to determine what a stock ""should be worth"" that depending on what you want to believe there are more than a few ways one could go." "The key to evaluating book value is return on equity (ROE). That's net profit divided by book value.  The ""value"" of book value is measured by the company's ROE (the higher the better). If the stock is selling below book value, the company's assets aren't earning enough to satisfy most investors. Would you buy a CD that was paying, say two percentage points below the going rate for 100 cents on the dollar? Probably not. You might be willing to buy it only by paying 2% less per year, say 98 cents on the dollar for a one year CD. The two cent discount from ""book value"" is your compensation for a low ""interest"" rate." "You can calculate the ""return on investment"" using libreoffice, for example. Look at the xirr function. You would have 2 columns, one a list of dates (ie the dates of the deposits or dividends or whatever that you want to track, the last entry would be today's date and the value of the investment today. The xirr function calculates the internal rate of return for you. If you add money to the account, and the current value includes the original investment and the added funds, it will be difficult to calculate the ROI. If you add money by purchasing additional shares (or redepositing dividends by buying additional shares), and you only want to track the ROI of the initial investment (ignoring future investments), you would have to calculate the current value of all of the added shares (that you don't want to include in the ROI) and subtract that value from the current total value of the account. But, if you include the dates and values of these additional share purchases in the spreadsheet, xirr will calculate the overall IRR for you." "According to the following article the answer is ""first-in, first-out"": http://smallbusiness.chron.com/calculate-cost-basis-stock-multiple-purchases-21588.html According to the following article the last answer was just one option an investor can choose: https://www.usaa.com/inet/pages/advice-investing-costbasis?akredirect=true" Is there a way in bloomberg to calculate the total return if one purchased $100 worth of 10 Year US Notes at time X and perpetually rolled the principal once the bond matured until the present?   I've been able to historically use the COMP function to compare equity and ETF total returns, but curious if this function can be expanded to measure returns against commodities, treasuries, and other debt products. Unfortunately im having trouble pulling in the appropriate continuous commodity and treasury tickers. Stock price = Earning per share * P/E Ratio. Most of the time you will see in a listing the Stock price and the P/E ration. The calculation of the EPS is left as an exercise for the student Investor. Stocks represent partial ownership of the company. So, if you owned 51% of the stock of the company (and therefore 51% of the company itself), you could decide to liquidate all the  assets of the company, and you would be entitled to 51% of the proceeds from that sale.  In the example above, it would have to be Common Stock, as preferred stock does not confer ownership. *In a situation where it is not possible to buy 51% or more of the company (for example, it's not for sale), this is not possible, so the value of the stock could be much less. There is no formula for calculating a stock price based on the financials of a company. A stock price is set by the market and always has a component built into it that is based on something outside of the current valuation of a company using its financials. Essentially, the stock price of a company per share is whatever the best price it can get on the open market. If you are looking at how to evaluate if a stock is a good value at the current price, then look at some of the answers, but I wanted to answer this based on the way you phrased the question. Actually, total return is the most important which isn't necessarily just price change as this doesn't account for dividends that may be re-invested.  Thus, the price change isn't necessarily that useful in terms of knowing what you end up with as an ending balance for an investment. Secondly, the price change itself may be deceptively large as if the stock initial price was low, e.g. a few dollars or less adjusting for stock splits as most big companies will split the stock once the price is high enough, then the percentages can be quite large years later. Something else to consider is the percentage change would be based on what as the initial base.  The price at the start of the chart or something else?  Carefully consider what you want the initial starting point to be in determining price shifts here as one could take either end and claim a rationale for using it. Most people want to look at the price to get an idea of what would X shares cost to purchase rather than look at the percentage change from day to day.