com.fisincorporated.stockinfoserver
Class YahooServer

java.lang.Object
  extended bycom.fisincorporated.stockinfoserver.YahooServer

public class YahooServer
extends java.lang.Object

Use Yahoo Finance as source of stock info. Create a Stock object from stock info supplied from Yahoo. Started from Joone YahooInputSynapse but wanted to use for StockImager and Jess. Reinventing the wheel?

The YahooServer provides support for financial data input from financial markets. The synapse contacts YahooFinance services and downloads historical data for the chosen symbol and date range. Finally the data is presented to the network in reverse date order i.e oldest first.

This synapse provides the following info ..

Open as column 1

High as column 2

Low as column 3

Close as column 4.

Volume as column 5.

For the particular stock symbol.


Developer Notes :

This YahooServer uses the following format to extract stock financial information from the Yahoo Network

.

http://table.finance.yahoo.com/table.csv?a=8&b=1&c=2002&d=11&e=3&f=2002&s=tsco.l&y=0&g=d&ignore=.csv


a = From Month 0 - 11

b = From Day 1-31

c = From Year XXXX

d = To Month 0-11

e = To Day 1-31

f = To Year XXXX

s = Symbol

y = [record] from record to + 200 records

g=[d] or[m] or [y] - daily or monthly or yearly

ignore = .csv

Author:
Joone Project/

Eric Foertsch


Constructor Summary
YahooServer()
          Constructor for the YahooServer object
 
Method Summary
 java.lang.String getDateEnd()
          Gets year to end data retrieval from
 java.lang.String getDateStart()
          Gets year to start data retrieval from.
 java.lang.String getPeriod()
          Gets the period for data retrieval.
 Stock getStockData()
          Connects to Yahoo FInancial Services and obtains the historical data for the specifed symbol and data range.
 Stock getStockData(java.lang.String Symbol)
          Connects to Yahoo FInancial Services and obtains the historical data for the specifed symbol and data range.
 java.lang.String getSymbol()
          Gets the name of the symbol
static void main(java.lang.String[] args)
           
 void setDateEnd(java.lang.String newDateEnd)
          Sets the date for which data is retrieved.
 void setDateStart(java.lang.String newDateStart)
          Sets the date for which data is retrieved.
 void setPeriod(java.lang.String newPeriod)
          Sets the period with which to retrieve data should be one of "Daily" or "Monthly" or "Yearly".
 void setSymbol(java.lang.String newSymbol)
          Sets the stock symbol
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

YahooServer

public YahooServer()
Constructor for the YahooServer object

Method Detail

getSymbol

public java.lang.String getSymbol()
Gets the name of the symbol

Returns:
The Symbol name

getDateStart

public java.lang.String getDateStart()
Gets year to start data retrieval from.

Returns:
The year to start from

getDateEnd

public java.lang.String getDateEnd()
Gets year to end data retrieval from

Returns:
The year to end on

getPeriod

public java.lang.String getPeriod()
Gets the period for data retrieval.

Returns:
The month to end on

setSymbol

public void setSymbol(java.lang.String newSymbol)
Sets the stock symbol

Parameters:
newSymbol - The new stock symbol to retrieve the data with.

setDateStart

public void setDateStart(java.lang.String newDateStart)
Sets the date for which data is retrieved.

Parameters:
newDateStart - The data from which data is retrieved.

setDateEnd

public void setDateEnd(java.lang.String newDateEnd)
Sets the date for which data is retrieved.

Parameters:
newDateEnd - The date to which data is retrieved.

setPeriod

public void setPeriod(java.lang.String newPeriod)
Sets the period with which to retrieve data should be one of "Daily" or "Monthly" or "Yearly".

Parameters:
newPeriod - The period with which data is retieved.

getStockData

public Stock getStockData(java.lang.String Symbol)
                   throws java.lang.Exception
Connects to Yahoo FInancial Services and obtains the historical data for the specifed symbol and data range.

Throws:
java.lang.Exception

getStockData

public Stock getStockData()
                   throws java.lang.Exception
Connects to Yahoo FInancial Services and obtains the historical data for the specifed symbol and data range.

Throws:
java.lang.Exception

main

public static void main(java.lang.String[] args)