I had a total 821 shares of a stock that I sold 676 shares today. I bought them all at different times and prices. I use Scottrade to do my trades and I always keep track of my profits by using their Portfolio (Open Positions) screen which lists all the stock I own, the date I purchased them, the price, etc. etc. (I edit and update my positions myself). My question is: Since I did not sell all of my shares and now have 145 left, what buying price do I assign to them so I can keep track of my profits? Scottrade lumps them all together and doesn't look at it this way but I need to know what price to assign to them so I can see if I am making a profit or not. What about for tax purposes? Is this making sense to anyone? I'm kind of new to this so if this is a stupid question, I'm sorry but I really need some help here!