Friday, February 11, 2011

Stock Market Ticker For Website - Getting Historical Data

To get Historical Data from Yahoo Finance, we can use certain parameters in Query String. Check out following query string for NASDAQ (i.e. Symbol "^IXIC");
http://ichart.finance.yahoo.com/table.csv?s=^IXIC&a=01&b=5&c=1971&d=01&e=8&f=2011&g=m&ignore=.csv
 If we analyze above link we can see some parameters varying from a to g. We can use these parameters to filter HISTORICAL data as per our requirement. Each of above parameter (i.e. from a to g) indicates following things
  • s - Ticker symbol.(This parameter is not optional; other parameters are optional)
  • a - Month number, starting with 0 for January.
  • b - Day number, eg, 1 for the first of the month.
  • c - Year.

    End date for historical prices (default is the most current available closing price):
  • d - Month number, starting with 0 for January.
  • e - Day number, eg, 1 for the first of the month.
  • f - Year.
  • g - Possible values are 'd' for daily (the default), 'w' for weekly, and 'm' for monthly.

We can download csv file and modify its URL run time as per our requirements.
Submit this story to DotNetKicks

1 comments:

Unknown May 27, 2014 at 4:21 PM  
This comment has been removed by the author.