Return on investment is calculated by taking the value of the investment held at the beginning of the ROI period compared to the current value. In other words:
((Current Value) - (Beginning Value) + (Income))
________________________________________________, where
(Beginning Value)
(Current Value) = (the current total shares) x (the last price),
(Beginning Value) = [(Number of shares held prior to the period - any shares sold) x (the closing price prior to the period)] + the "Cost Basis" of any shares added in this period (Buys, Reinvest, Add Shares, etc), and
(Income) = any income events such as Dividends/Interest (not Reinvested) and Realized gain/loss from Sells in this period.
For example, assume that on 1/1/99 you owned 1000 shares of XXYY (which had been purchased prior to this date), the last price (on 12/31/98) was Rs.69 11/32, and you still own the 1000 shares and the current price is Rs.90 1/8. The ROI (YTD) for XXXX Script would be calculated:
[(1000 x 90.125) - (1000 x 69.34375)] / (1000 x 69.34375) = 20781.25/69343.75 = 29.968%
If you had purchased 200 additional shares at Rs.75 each during this period, the formula would be modified as follows:
[(1200 x 90.125) - (1000 x 69.34375 + 200 x 75)] / (1000 x 69.34375 + >200 x 75) = 23806.25/84343.75 = 28.225%