MATLAB > Time Series > Time Series |
hist = getyearlytail(connection, symbol, years, leadLag, currency, currencySource, unit)
hist = getyearlytail(connection, symbol, years, leadLag, currency, currencySource, unit) takes a connection created using a call to gvconnect, symbol and a number of years, plus other optional parameters and returns a standard Matlab tscollection object with last N years of history data.
Optional parameter leadLag controls how much the data will be shifted into the future or past. Currency and currency source control currency conversions, and the unit parameter contols unit coversions.
>> ts = getyearlytail(con,'/GCL',10)
Time Series Collection Object: /GCL
Time vector characteristics
Start date 01-Jan-2002 00:00:00
End date 01-Jan-2011 00:00:00
Member Time Series Objects:
Open
High
Low
Close
Volume
OpenInterest
>> ts = getyearlytail(con,'/GCL',10,con.CalendarDays(5))
>> ts = getyearlytail(con,'/GCL',10,con.QuotedDays(5))
>> ts = getyearlytail(con,'/GCL',10,[],'EUR')
>> ts = getyearlytail(con,'/GCL',10,[],'EUR','USF')
>> ts = getyearlytail(con,'/GCL',10,[],[],[],con.Barrels);
>> ts = getyearlytail(con,'/GCL',10,[],[],[],con.Liters);
>> ts = getyearlytail(con,'/GCL',10,[],[],[],con.Kiloliters);
>> ts = getyearlytail(con,'/GCL',10,[],[],[],con.CubicMeters);
>> ts = getyearlytail(con,'/GCL',10,[],[],[],con.Gallons);
>> ts = getyearlytail(con,'/GCL',10,[],[],[],con.ThouStdCubicFt);
>> ts = getyearlytail(con,'/GCL',10,[],[],[],con.MetricTons);
>> ts = getyearlytail(con,'/GCL',10,[],[],[],con.ShortTons);
>> ts = getyearlytail(con,'/GCL',10,[],[],[],con.MMBTUs);
>> ts = getyearlytail(con,'/GCL',10,[],[],[],con.Therms);
>> ts = getyearlytail(con,'/GCL',10,[],[],[],con.Gigajoules);
>> ts = getyearlytail(con,'/GCL',10,[],[],[],con.GigawattHours);
>> ts = getyearlytail(con,'/GCL',10,[],[],[],con.KilowattHours);
>> ts = getyearlytail(con,'/GCL',10,[],[],[],con.MegawattHours);