As long as historical quotes of a stock or index in available in Yahoo Finance, we can use following function to get financial data.
Options[YahooFinancialData] := {StartDate -> {0, 0, 0}, EndDate -> {0, 0, 0}, TradingPeriods -> "d"};
YahooFinancialData[id_String, opts : OptionsPattern[]] :=
Module[
{startDate, endDate, tradingPeriods},
startDate = ToString /@ OptionValue[StartDate];
endDate = ToString /@ OptionValue[EndDate];
tradingPeriods = OptionValue[TradingPeriods];
Import[
"http://ichart.yahoo.com/table.csv?s=" <>
id <>
"&a=" <>
startDate[[2]] <>
"&b=" <>
startDate[[3]] <>
"&c=" <>
startDate[[1]] <>
"&d=" <>
endDate[[2]] <>
"&e=" <>
endDate[[3]] <>
"&f=" <>
endDate[[1]] <>
"&g=" <>
tradingPeriods,
"Data"
]
]
For more information on how to use the function please check the attached notebook.
Attachments: