10 messages in com.googlegroups.google-finance-apis[Google Finance APIs] Re: additional ...
FromSent OnAttachments
ChrisSep 30, 2008 11:14 am 
ChrisOct 3, 2008 2:21 pm 
DineshOct 3, 2008 8:46 pm 
Doug ChimentoOct 4, 2008 9:35 am 
DineshOct 4, 2008 9:34 pm 
Cham...@gmail.comOct 6, 2008 2:26 pm 
Dion Loy (Google)Oct 6, 2008 3:12 pm 
Cham...@gmail.comOct 7, 2008 8:17 am 
Dion Loy (Google)Oct 8, 2008 9:59 am 
Cham...@gmail.comOct 8, 2008 4:39 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[Google Finance APIs] Re: additional returns data not as describedActions...
From:Cham...@gmail.com (Cham@gmail.com)
Date:Oct 8, 2008 4:39:11 pm
List:com.googlegroups.google-finance-apis

This still does not return what I need.

FeedQuery query = new FeedQuery("http://finance.google.com/finance/ feeds/default/portfolios/106?positions=true");

returns only a single entry with the position data of the entire portfolio, not broken up as individual positions as I'd like to see:

<?xml version="1.0" encoding="utf-8"?> <entry xmlns="http://www.w3.org/2005/Atom" xmlns:gf="http:// schemas.google.com/finance/2007" xmlns:gd="http://schemas.google.com/g/ 2005"> <gd:feedLink href="http://finance.google.com/finance/feeds/ exam@gmail.com/portfolios/106/positions" /> <gf:portfolioData currencyCode="USD" gainPercentage="-0.8999921561" return1w="-0.8999921561" return1y="-0.8999921561" return3m="-0.8999921561" return3y="-0.8999921561" return4w="-0.8999921561" return5y="-0.8999921561" returnOverall="-0.8999921561" returnYTD="-0.8999921561"> <gf:costBasis> <gd:money amount="1275.0" currencyCode="USD" /> </gf:costBasis> <gf:daysGain> <gd:money amount="-1.590001" currencyCode="USD" /> </gf:daysGain> <gf:gain> <gd:money amount="-1147.489999" currencyCode="USD" /> </gf:gain> <gf:marketValue> <gd:money amount="127.510001" currencyCode="USD" /> </gf:marketValue> </gf:portfolioData> <title type="text">NinjaTrader_0</title> <id>http://finance.google.com/finance/feeds/exam@gmail.com/ portfolios/106</id> <link href="http://finance.google.com/finance/feeds/default/ portfolios/106" rel="self" type="application/atom+xml" /> <link href="http://finance.google.com/finance/feeds/default/ portfolios/106" rel="edit" type="application/atom+xml" /> <category term="http://schemas.google.com/finance/2007#portfolio" scheme="http://schemas.google.com/g/2005#kind" /> <content type="text" /> <updated>2008-10-08T17:27:47-06:00</updated> </entry>

I've also tried what I think should be the correct feed request of:

FeedQuery query = new FeedQuery("http://finance.google.com/finance/ feeds/default/portfolios/106?positions=true&returns=true");

which actually returns the same data as above. I've tried every other variation with no avail, can anyone confirm that it is possible to retrieve all of the portfolio position data with a single feed request?

On Oct 8, 10:59 am, "Dion Loy (Google)" <dloy+gro@google.com> wrote:

In that case, you probably want the top-level portfolio feed with the "positions=true" parameter:

/finance/feeds/default/portfolios/70?positions=true

These are summarized in the reference guide under 'query parameters':

http://code.google.com/apis/finance/reference.html#Parameters

Hope that helps!

On Oct 7, 8:17 am, "Cham@gmail.com" <Cham@gmail.com> wrote:

I was of the understanding that the following feed was supposed to return all of the position data (including Cost Basis, Day's Gain, Total Gain, and Market Value) from the designated portfolio:

You would be correct using the feed you mentioned would return the data for that specific position. I am however trying to retrieve all the data from a single feed request, is this possible?

Very simply, with a single feed request can I retrieve the Market value of each position in my portfolio?

On Oct 6, 4:13 pm, "Dion Loy (Google)" <dloy+gro@google.com> wrote:

You seem to be requesting the transactions feed instead of the positions feed. Have you tried:

http://finance.google.com/finance/feeds/exam...@gmail.com/portfolios/70/posi@

(without the /transactions at the end)

On Oct 6, 2:26 pm, "Cham@gmail.com" <Cham@gmail.com> wrote:

Hey Doug,

I tried your method, and got a modicum of success but only on pulling the portfolio statistics as a whole, not on a per position basis. I'm having the same issue that Dinesh in the are that none of the costBasis/daysGain/marketValue data is being returned. I've attempted adding data manually through the web interface with the necessary transaction data that you had mentioned, along with trying to insert using the following XML:

string xmlData = @"<?xml version=""1.0"" encoding=""utf-8""?>"                                                                 + @"<entry
xmlns=""http://www.w3.org/2005/Atom"" xmlns:gf=""http://schemas.google.com/finance/2007"" xmlns:gd=""http:// schemas.google.com/g/2005"">"                                                                 +
"<gf:transactionData date='" + DateTime.Now.ToString("yyyy- MM-dd") + "T00:00:00.000' shares='1.0' type='Buy'>"                                                                 +
"<gf:commission><gd:money amount='100.0' currencyCode='USD'/>"

                                                                +
"</gf:commission>"                                                                 + "<gf:price>"                                                                 + "<gd:money
amount='100.0' currencyCode='USD'/>"                                                                 +
"</gf:price></gf:transactionData></entry>";

and the following URI: "http://finance.google.com/finance/feeds/ exam@gmail.com/portfolios/70/positions?returns=true"

I have two transactions in my portfolio

Name            Symbol  Last price    Change                   Shares Cost basis      Mkt value       Gain    Gain %  Day's gain      Overall Return Google Inc.     GOOG    369.14       -17.77 (-4.59%)    1.00      123.00 369.14  246.14  200.11%         (17.77)         200.11% Apple Inc.      AAPL    98.14        +1.07 (1.10%)            1.00              
0.00                 98.14   98.14   0.00%   1.07

As you can tell all the data that I need is available within the web interface. However, the two entries that are returned are like this:

<?xml version="1.0" encoding="utf-8"?> <entry xmlns="http://www.w3.org/2005/Atom">   <gd:feedLink href="http://finance.google.com/finance/feeds/ exam@gmail.com/portfolios/70/positions/NASDAQ:GOOG/transactions" xmlns:gd="http://schemas.google.com/g/2005" />   <gf:positionData gainPercentage="0.0" return1w="0.0" return1y="0.0" return3m="0.0" return3y="0.0" return4w="0.0" return5y="0.0" returnOverall="0.0" returnYTD="0.0" shares="1.0" xmlns:gf="http:// schemas.google.com/finance/2007" />   <gf:symbol exchange="NASDAQ" fullName="Google Inc." symbol="GOOG" xmlns:gf="http://schemas.google.com/finance/2007" />   <title type="text">Google Inc.</title>   <id>http://finance.google.com/finance/feeds/Champ@gmail.com/ portfolios/70/positions/NASDAQ:GOOG</id>   <link href="http://finance.google.com/finance/feeds/champatcu %40gmail.com/portfolios/70/positions/NASDAQ%3AGOOG" rel="self" type="application/atom+xml" />   <category term="http://schemas.google.com/finance/2007#position" scheme="http://schemas.google.com/g/2005#kind" />   <content type="text" />   <updated>2008-10-06T15:11:49-06:00</updated> </entry>

and

<?xml version="1.0" encoding="utf-8"?> <entry xmlns="http://www.w3.org/2005/Atom">   <gd:feedLink href="http://finance.google.com/finance/feeds/ exam@gmail.com/portfolios/70/positions/NASDAQ:AAPL/transactions" xmlns:gd="http://schemas.google.com/g/2005" />   <gf:positionData gainPercentage="0.0" return1w="0.0" return1y="0.0" return3m="0.0" return3y="0.0" return4w="0.0" return5y="0.0" returnOverall="0.0" returnYTD="0.0" shares="1.0" xmlns:gf="http:// schemas.google.com/finance/2007" />   <gf:symbol exchange="NASDAQ" fullName="Apple Inc." symbol="AAPL" xmlns:gf="http://schemas.google.com/finance/2007" />   <title type="text">Apple Inc.</title>   <id>http://finance.google.com/finance/feeds/Champ@gmail.com/ portfolios/70/positions/NASDAQ:AAPL</id>   <link href="http://finance.google.com/finance/feeds/champatcu %40gmail.com/portfolios/70/positions/NASDAQ%3AAAPL" rel="self" type="application/atom+xml" />   <category term="http://schemas.google.com/finance/2007#position" scheme="http://schemas.google.com/g/2005#kind" />   <content type="text" />   <updated>2008-10-06T15:13:43-06:00</updated> </entry>

Both of which are still as described before regardless of the additional transaction data.

The only way I can get anything close to what you have show is changing the URI to this: query.Uri = new Uri("http://finance.google.com/finance/feeds/ exam@gmail.com/portfolios/70?returns=true");

which returns the portfolio data as a single entry as follows

<?xml version="1.0" encoding="utf-8"?> <entry xmlns="http://www.w3.org/2005/Atom" xmlns:gf="http:// schemas.google.com/finance/2007" xmlns:gd="http://schemas.google.com/g/ 2005">   <gd:feedLink href="http://finance.google.com/finance/feeds/ exam@gmail.com/portfolios/70/positions" />   <gf:portfolioData currencyCode="USD" gainPercentage="2.799024504" return1w="2.799024504" return1y="2.799024504" return3m="2.799024504" return3y="2.799024504" return4w="2.799024504" return5y="2.799024504" returnOverall="2.799024504" returnYTD="2.799024504">     <gf:costBasis>       <gd:money amount="123.0" currencyCode="USD" />     </gf:costBasis>     <gf:daysGain>       <gd:money amount="-16.699989" currencyCode="USD" />     </gf:daysGain>     <gf:gain>       <gd:money amount="344.280014" currencyCode="USD" />     </gf:gain>     <gf:marketValue>       <gd:money amount="467.280014" currencyCode="USD" />     </gf:marketValue>   </gf:portfolioData>   <title type="text">NinjaTrader_0</title>   <id>http://finance.google.com/finance/feeds/Champ@gmail.com/ portfolios/70</id>   <link href="http://finance.google.com/finance/feeds/champatcu %40gmail.com/portfolios/70" rel="self" type="application/atom+xml" />   <link href="http://finance.google.com/finance/feeds/champatcu %40gmail.com/portfolios/70" rel="edit" type="application/atom+xml" />   <category term="http://schemas.google.com/finance/2007#portfolio" scheme="http://schemas.google.com/g/2005#kind" />   <content type="text" />   <updated>2008-10-06T15:23:21-06:00</updated> </entry>

close but no cigar. Any other thoughts? Dinesh, are you still running into the same issue?

On Oct 4, 10:35 am, "Doug Chimento" <dchi@gmail.com> wrote:

Chris,  I think the confusion maybe that your portfolio does not have any transactions. By transaction I mean you have entered a date,amount, and number of shares for a stock. Without those three pieces of info, google can't calculate market value. Google allows you to enter a "basic" transaction,  which means ONLY  a stock symbol. As an example, below is a query/result from my portfolio.  The 1st symbol has a date,amount and number of shares and so google can calculate market value. The 2nd entry is only a "basic" transaction, and so Google can't calc market value. I hope this helps.

GET /finance/feeds/dchi@gmail.com/portfolios/1/positions?returns=true HTTP/1.1

read more »