public class

FinanceUtilities

extends Object
java.lang.Object
   ↳ com.google.gdata.client.finance.FinanceUtilities

Class Overview

FinanceUtilities contains useful methods related to the Finance GData API

Summary

Public Methods
static PortfolioEntry makePortfolioEntry(String portfolioName, String currencyCode)
Creates a portfolio entry object.
static TransactionEntry makeTransactionEntry(String type, String date, String shares, String price, String commission, String currency, String notes)
Creates a transaction entry object.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static PortfolioEntry makePortfolioEntry (String portfolioName, String currencyCode)

Creates a portfolio entry object.

Parameters
portfolioName The name of the new portfolio. e.g. "Oil & Gas". This is required when creating a portfolio, but optional when updating.
currencyCode The ISO4217 currency code for the portfolio. e.g. USD, EUR, JPY, GBP, CAD, HKD, etc. This is required when creating a portfolio, but optional when updating.
Returns
  • the newly created portfolio entry

public static TransactionEntry makeTransactionEntry (String type, String date, String shares, String price, String commission, String currency, String notes)

Creates a transaction entry object.

Parameters
type The type of transaction (one of "Buy", "Sell", "Sell Short", "Buy to Cover"). This should be specified. In this method, the type will be set to "Buy" if left unspecified.
date The date of the transaction in the format YYYY-MM-DD. This is optional ("watchlist" or "holding" items might not have a date). If left unspecified, this parameter should be an empty string.
shares The number of shares/units involved in a transaction. This does not have to be a whole number quantity (e.g. 10.1 is valid). This is optional ("watchlist" entries need not have a share count)
price The transaction unit price (e.g. 99.99). This is optional.
commission The transaction commission (e.g. 25.0). This is optional.
currency The ISO4217 currency code for the transaction price and commission. e.g. USD, EUR, JPY, GBP, CAD, HKD, etc. This is required only if price or commission have been specified.
notes Any notes related to the transaction. This is optional.
Returns
  • the newly created transaction entry