Re: FinancialData
- To: mathgroup at smc.vnet.net
- Subject: [mg118129] Re: FinancialData
- From: Chris Degnen <degnen at cwgsy.net>
- Date: Wed, 13 Apr 2011 05:54:45 -0400 (EDT)
- References: <inunf2$2gb$1@smc.vnet.net>
On Apr 11, 12:08 pm, Leonardo <matematic... at gmail.com> wrote: > Is possible to have data for every n minutes of a stock index? > > Example: > > Column [FinancialData ["SP500", {{2011, 4, 1}, {2011, 4, 1}, "Day"}]] > > for daily data. > > Is there a way to get data every hour? > > Or have data every n minutes? > > Thanks. > > E' possibile avere dati ogni n minuti di un indice azionario? > > Esempio: > > Column[FinancialData["SP500", {{2011, 4, 1}, {2011, 4, 1}, "Day"}]] > > per avere dati giornalieri. > > Esiste un modo per avere dati ogni ora? > > Oppure avere dati ogni n minuti? > > Grazie. If you are using Mathematica 8 you can use RunScheduledTask, http://reference.wolfram.com/mathematica/ref/RunScheduledTask.html But if you are on version 6 or 7 you can use something like this: prices = {}; GetPrices := AppendTo[prices, Flatten@{FinancialData[#] & /@ {"^FTSE", "^GSPC"}, DateString[{"Time", " ", "Day", "/", "Month", "/", "Year"}]}] Dynamic[ti60 = Refresh[DateString["Second"], UpdateInterval -> 3]] doOnce = True; Dynamic[ If[EvenQ[ToExpression[ti60]], If[doOnce == True, GetPrices; doOnce = False], doOnce = True]] Dynamic[TableForm[If[Length[prices] > 4, Take[prices, -4], prices], TableHeadings -> {None, {"FTSE 100", "S&P 500", "Time & date"}}, TableSpacing -> {1, 2}]]