I'm fairly sure this is completely wrong.
The "price" is where asks meet the bids. So what matters are the high bids and the low asks. The quantity you're calculating is instead affected mostly by the low bids and high asks. If I place a bid of 100000 BTC at $0.01, it will have absolutely no affect on the trading price but will significantly drop your calculated price.
I'm talking about true value rather than actual value. The further out the bid and ask prices are (ie, the spread) the less impact they have on the price however this is way to complicated to go into here. If you place a 100000 BTC at $0.01 it will have very little impact in reality due to that additional distance factor but I was just stating the principle. Weighting would also need to factor in the calculation and I will work on that at a later date. I plan to automate the stats.
Paul.