Compute average price even if I do not have the prices before
What I do have is this (sample only): Stock X: Average Price of all I purchased before = 80 Total Shares = 200 So if Stock X's price today is 100 how do I know how much my average price will be? Using your sample if you buy 100 new shares and the price is 85 for the purpose of this example your previous total cost is $16,000 ($80 average cost * 200 shares).  With the new example you are adding $8500 to your total cost (100 new shares * $85 example cost per share)  that gives us a total cost of $24,500 and 300 shares. $24,500/300 gives us an average cost of $81.67 per share. As long as you have the average cost and the number of shares you can calculate a new average without knowing what the price was for each transaction. It may still become important to find the price information for tax purposes if you do not sell all of those shares at once and use FIFO for your taxes.
"To answer the investment aspect takes a bit of math. First, solar insolation numbers:  This represents the average sun-hours per day for a given area. You can see the range from 4 to 6, or 1460 hrs to about 2190 hrs of sun per year depending on location. I believe electricity also has a range of cost, but 15 cents per KWH is a good average.  So, a 1KW panel will produce as much as $328 per year of electricity in a high sun-hrs area, but only $219 in a lower sun-hrs area.  If we agree to ignore the government subsidies and look for the stable price unaffected by outside influence, an installed price of even $2500 would produce a return of 13% and a reasonable full payback over an 8 year period.  I call this installed price a tipping point, the price where this purchase provides a decent return. Some would accept a lower return, and therefore a higher price. As duff points out, this should be treated as the post rebate/tax credit price. Those help to push the price below this point. At the price point where the energy cost per panel is below, the government intervention may be unnecessary. The power companies may find consumer owned panels are the cheapest way to clip the peak consumption which tends to be the most expensive power demand.) One can take the insolation numbers and cost of local power to produce a grid showing the return for a 1KW panel in $$/year. (At this point the cost of money kick in. The present value of $100/yr is far higher today than if short term rates were say, 8%)  Once panels drop to where they are compelling for the higher return areas, I'd expect volume to drive continued improvements in cost and better economies of scale. Initially, the need for storage isn't there, as the infrastructure is in place to drive your meter backwards if you produce more than you use. The peek sun coincides with peek demand and the electric companies are happy to have your demand go negative during those times.  Update - the conversation with Duff led me to research 'demand charge' a bit more. You see, the utility company has to have equipment to generate the peak demand, usually occurring in the early afternoon, say 12N-2PM as the sun is brightest and AC use in particular, highest. I found that Austin energy has a PDF describing the fee for this. Simply put, the last kW of demand will cost you $14.03 in summer months and $12.65 in winter. This adds to $160/yr that a 1kW panel might save the owner. Even if one does capture the full power at peak every month, $100 is still non-trivial. This factor alone justifies $1000 worth of panel cost, and as Duff points out, the government may find it cheaper to use this method to clip peak demand than by funding bigger power generators.  To summarize, the question isn't so much ""are they worth it"" as ""what is a xKW panel worth?"" (A function of annual savings and time value of money.) The ever decreasing installed cost for a given system makes solar an inevitable part of the future power technology. I am not a green tree hugging guy, but I do like to breathe fresh air as much as anyone. I'm happy with whatever role solar plays in cutting down pollution." As you point out, the moving average is just MA(k)t = (Pt-1 + … + Pt-k )/k and is applied in technical analysis (TA) to smooth out volatile (noise) price action. If it has any logic to it, you might want to think in terms of return series (Pt - Pt-1 / Pt-1) and you could hypothesize that prices are in fact predictable and will oscillate below and above a running moving average.  Below is a link to a study on MA trading rules, published in the Journal of Finance, with the conclusion of predictive power and abnormal returns from such strategies. As with any decision made upon historical arguments, one should be aware of structural changes and or data mining.  Simple  technical trading rules and the stochastic properties of stock  returns Brock, W., J. Lakonishok and B. Le Baron, 1992, Simple technical trading rules and the stochastic properties of stock returns, Journal of Finance, 47, 1731-64. MA rules betterthan chance in US stock market, 1897-1986 I don't know whether you are new to TA or not, but a great commercial site, with plenty of computer-generated signals is FinViz. "A key principle of economics is: Sunk costs are irrelevant. You bought the stock at 147 and it has now fallen to 144. That's too bad. This has nothing to do with whether it is wise or foolish to buy shares at 144. The only relevant thing to consider is: Do I expect the stock to go up or down from 144? You have lost $3 per share on the original buy. Buying more shares will not ""reduce your loss"" in any way. Suppose you bought 100 shares at 147. The price then drops to 144. You have lost $3 per share, or $300 total. You buy another 50 more shares at 144. The price stays at 144. So your average purchase price is now (147 x 100 + 144 x 50) / 150 = 146. So I guess you could say that your ""average loss per share"" is now only $2. But it's $2 x 150 shares instead of $3 x 100 shares. You still lost $300. You didn't reduce your loss by a penny. Maybe it made you feel better that you reduced your average loss per share, but this is just an arithmetic game. If you believe that the stock will continue to drop, than buying more shares just means you will lose even more money. Your average loss per share may go down, but you're just multiplying that average by more and more shares. Of course if you believe that the stock is now at an unjustifiably low price and it will likely go back up, then sure, buy. If you buy at 144 and it goes back up to 147, then you'll be making $3 per share on the new shares you purchased. But I repeat, whether or not you buy more shares should have nothing to do with your previous buy. Buy more shares if you think the price will go up from the present price; don't buy more shares if you don't think it will go up. The decision should be exactly the same as if you had never previously bought shares. (I'm assuming here that you are a typical small investor, that you not buying enough shares to have any significant effect on the market, nor that you are in a position to buy enough shares to take control of the company.)" One could use technical indicators in any number of ways...they aren't rigidly defined for use in any particular way.  If they were, only computers would use them. Having said that, moving averages are frequently used by people operating on the assumption that short-term price movements will soon be reverted back to a longer-term mean.  So if the price shoots up today, traders who use moving averages may believe it will come back down pretty soon.  If this is the belief (and it usually is for this type of trader), a price significantly above a moving average could indicate an overpriced stock.  A price below the moving average could indicate an underpriced stock. Similarly, a short-term moving average above the long-term moving average may indicate an overpriced stock.  When you are dealing with more than one frequency, though, there is more disagreement about how to use technical indicators.  Some traders would probably say the opposite: that a short term average above the long term average indicates an upward movement that will continue because they believe the stock has momentum. Note that I am not saying I believe in using these averages to predict mean reversion or momentum effects, just that traders who rely on moving averages frequently do. Any time you are optimizing a portfolio, the right horizon to use for computing the statistics you will use for optimization (expected return, covariance, etc.) will be the same as your rebalance/trading frequency.  If you expect your trading strategy to trade once a day, you should use daily data for optimization.  Ditto for monthly or quarterly.  If at all possible you should use statistics across the board that are computed at the same frequency as your trading. Regarding currency pricing, I see no reason you can't take the reported prices and convert them to whatever currency you want using that day's foriegn exchange rate.  Foreign exchange rates are available for free at the Fed and elsewhere.  Converting prices from one currency to another is not rocket science. Since you are contemplating putting actual money behind this, note that using data to compute statistics is less reliable for lower statistical moments.  The mean (expected return) is the first moment, so using historical returns is extremely unreliable at predicting future returns.  The variances and covariances are second moments, they are better.  Skewness and kurtosis, yet better.  The fact that the expected return can't reliably be estimated from past returns is the major downfall of the Markowitz method (resulting portfolios are often very crazy and will depend critically on the data period you use to set them up).   There are approaches to fixing this, such as Black-Litterman's (1992) method, but they get complicated fast. This is a note from my broker, CMC Markets, who use Morningstar: Morningstar calculate the P/E Ratio using a weighted average of the most recent earnings and the projected earnings for the next year. This may result in a different P/E Ratio to those based solely on past earnings as reported on some sites and other publications. They show the P/E as being 9.93. So obviously past earnings would usually be used but you would need to check with your source which numbers they are using. Also, as BHP's results just came out yesterday it may take a while for the most recent financial details to be updated. Calculating and adjusting cost basis accurately is a daunting task, but there is a (paid) online tool, NetBasis, which will automatically calculate and adjust your cost basis.  It is used by brokerage firms and Fortune 500 companies and is available to the public.  Go to netbasis.com. All you need are the purchase and sale dates and shares of the stock or mutual fund and the system has the rest of the information, such as corporate actions (splits, spin-offs, etc), pricing, and dividends and it also will apply the appropriate IRS rules for inherited and gifted shares. The regulation also gives investors the option to choose calculation methods.  Not only does NetBasis automatically calculate the method you choose, it will also give the results for all options and allow you to choose the best result. NetBasis also provides you with detailed supporting documentation which shows all of the calculations and the adjustments in chronological order. NetBasis has data going back as far as 1925, so it will accurately calculate cost basis for your old American Telegraph and Telephone shares. NetBasis also handles complex investment scenarios such as wash sales, short sales, return of capital, etc. Moderator's note: Disclosure: The answerer's profile indicates they are affiliated with NetBasis. "What you are looking for is an indicator called the ""Rate of Change (Price)"". It provides a rolling % change in the price over the period you have chosen.  Below is an example showing a price chart over the last 6 months with a 100 day Rate of Change indicator below the price chart."