

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
10 messages in com.googlegroups.google-finance-apis[Google Finance APIs] Re: additional ...| From | Sent On | Attachments |
|---|---|---|
| Chris | Sep 30, 2008 11:14 am | |
| Chris | Oct 3, 2008 2:21 pm | |
| Dinesh | Oct 3, 2008 8:46 pm | |
| Doug Chimento | Oct 4, 2008 9:35 am | |
| Dinesh | Oct 4, 2008 9:34 pm | |
| Cham...@gmail.com | Oct 6, 2008 2:26 pm | |
| Dion Loy (Google) | Oct 6, 2008 3:12 pm | |
| Cham...@gmail.com | Oct 7, 2008 8:17 am | |
| Dion Loy (Google) | Oct 8, 2008 9:59 am | |
| Cham...@gmail.com | Oct 8, 2008 4:39 pm |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread 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 described | Actions... |
|---|---|---|
| From: | Cham...@gmail.com (Cham...@gmail.com) | |
| Date: | Oct 6, 2008 2:26:23 pm | |
| List: | com.googlegroups.google-finance-apis | |
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
<entry><id>http://finance.google.com/finance/feeds/dchime...@gmail.com/portfolios/1...@</id>
<updated>2008-10-04T16:22:49.000Z</updated>
<category scheme='http://schemas.google.com/g/2005#kind'
term='http://schemas.google.com/finance/2007#position'/>
<title type='text'>UltraShort Russell2000 ProShares</title>
<link rel='self' type='application/atom+xml'
href='http://finance.google.com/finance/feeds/dchimento%40gmail.com/portfol...>
<gd:feedLink
href='http://finance.google.com/finance/feeds/dchime...@gmail.com/portfolios/1/positions/AM...@'/>
<gf:positionData gainPercentage='-0.1127551327'
return1w='0.2734328793' return1y='-0.1127551327'
return3m='-0.1127551327' return3y='-0.1127551327'
return4w='-0.1127551327' return5y='-0.1127551327'
returnOverall='-0.1127551327' returnYTD='-0.1127551327'
shares='100.0'>
<gf:costBasis><gd:money amount='9800.0'
currencyCode='USD'/></gf:costBasis>
<gf:daysGain><gd:money amount='657.0'
currencyCode='USD'/></gf:daysGain>
<gf:gain><gd:money amount='-1105.0003'
currencyCode='USD'/></gf:gain>
<gf:marketValue><gd:money amount='8694.9997'
currencyCode='USD'/></gf:marketValue>
</gf:positionData>
<gf:symbol exchange='AMEX' fullName='UltraShort Russell2000
ProShares' symbol='TWM'/></entry>
####################################################################################################
<entry><id>http://finance.google.com/finance/feeds/dchime...@gmail.com/portfolios/1/po...@</id>
<updated>2008-10-04T16:22:49.000Z</updated>
<category scheme='http://schemas.google.com/g/2005#kind'
term='http://schemas.google.com/finance/2007#position'/>
<title type='text'>Oracle Corporation</title><link rel='self'
type='application/atom+xml'
href='http://finance.google.com/finance/feeds/dchimento%40gmail.com/portfol...>
<gd:feedLink
href='http://finance.google.com/finance/feeds/dchime...@gmail.com/portfolios/1/positions/NASDA...@'/>
<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='0.0'/>
<gf:symbol exchange='NASDAQ' fullName='Oracle Corporation'
symbol='ORCL'/></entry
On Fri, Oct 3, 2008 at 5:22 PM, Chris <chri...@gmail.com> wrote:
On Oct 3, 11:21 am, Doug <dchi...@gmail.com> wrote:
Chris, Could you clarify what you mean by market value performance?
Thanks,
Doug
What I mean is the the actual MarketValue for the position. For example, here is the feed that is being returned by this URI: http://finance.google.com/finance/feeds/default/portfolios/54/positio...
<?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/54/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/exam...@gmail.com/ portfolios/54/positions/NASDAQ:AAPL</id> <link href="http://finance.google.com/finance/feeds/default/ portfolios/54/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-03T14:44:39-06:00</updated> </entry>
What I really want, and from what I understand, this is what it should return:
<?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/54/positions" /> - <gf:portfolioData currencyCode="USD" 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"> - <gf:costBasis> <gd:money amount="0.0" currencyCode="USD" /> </gf:costBasis> - <gf:daysGain> <gd:money amount="-3.029999" currencyCode="USD" /> </gf:daysGain> - <gf:gain> <gd:money amount="97.07" currencyCode="USD" /> </gf:gain> - <gf:marketValue> <gd:money amount="97.07" currencyCode="USD" /> </gf:marketValue> </gf:portfolioData> <title type="text">NinjaTrader0</title> <id>http://finance.google.com/finance/feeds/exam...@gmail.com/ portfolios/54</id> <link href="http://finance.google.com/finance/feeds/default/ portfolios/54" rel="self" type="application/atom+xml" /> <link href="http://finance.google.com/finance/feeds/default/ portfolios/54" 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-03T15:13:59-06:00</updated> </entry>
Specifically this is what I need:
<gf:marketValue> <gd:money amount="97.07" currencyCode="USD" /> </gf:marketValue>
which is the market value of that position at the current time. From my understanding, using this URI (http://finance.google.com/finance/ feeds/default/portfolios/54/positions?returns=true) should return the performance statistics on each position in the portfolio (in this case the portfolio numbered 54), yet the only data returned is as above.
So in a nutshell: How do I get the market value of each position in a portfolio using a singe URI request?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Finance APIs and Tools" group.
To post to this group, send email to goog...@googlegroups.com
To unsubscribe from this group, send email to
google-finance-apis+unsu...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/google-finance-apis?hl=en
-~----------~----~----~----~------~----~------~--~---







