Java: Get position's price Google Finance API
I need to use google finance api for my application and I must retrieve position's price.
I have looked for how to do that in the google docs but I have not find it.
I use Java api and I thought开发者_开发技巧 use PositionEntry and PositionData object but nothing about price into these objects.
So, how to retrieve this price ?
You can't directly access stock prices, using the Google Finance API, because they do not expose raw quote data due to data rights and licensing reasons.
You can compute it, however. Look at the transaction feed for a given position (You must own shares of the position, not just a 0-share entry.) Compute the total number of shares owned (cumulative buys less cumulative sells) and then look at the market value of the position.
Market value / number of shares owned = individual share price.
精彩评论