Imporing intraday data from Excel

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason

hendrix
Posts: 12
Joined: Thu Mar 25, 2010 6:18 am

Imporing intraday data from Excel

Postby hendrix » Mon Apr 12, 2010 2:39 am

Hi,

I'm trying to open some intraday futures data into eviews. The data is 5-minute interval with an 45 minute break from 1715-1800.

Code: Select all

DATE TIME 01.01.2009 5 01.01.2009 10 01.01.2009 15 01.01.2009 20 01.01.2009 25 ... 01.01.2009 1710 01.01.2009 1715 01.01.2009 1805 ... 01.01.2009 2359
The DATE coloumn is formatted as 'date' and TIME as 'general number' in Excel. I can't get eviews to recognize the format. I have also tried formatting TIME as 'time' with hh:mm as the format. Any ideas of what kind of structure to use when importing?

I'm using Eviews 7.1 and Excel 2010.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13586
Joined: Tue Sep 16, 2008 5:38 pm

Re: Imporing intraday data from Excel

Postby EViews Gareth » Mon Apr 12, 2010 7:57 am

Could you post the Excel file?

hendrix
Posts: 12
Joined: Thu Mar 25, 2010 6:18 am

Re: Imporing intraday data from Excel

Postby hendrix » Mon Apr 12, 2010 8:36 am

I'm not at my work pc at the moment so i don't have access to the original file, but this is a similar type of structure. Each day contains 279 5-min intervals.
Attachments
help.xlsx
(22.82 KiB) Downloaded 951 times

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13586
Joined: Tue Sep 16, 2008 5:38 pm

Re: Imporing intraday data from Excel

Postby EViews Gareth » Mon Apr 12, 2010 10:50 am

The problem you're going to have is with the "23:59" end point of the day. EViews will believe you have minute-by-minute data, with lots of missing observations (i.e. 01,02,03,04,06,07,08 etc...). What you really want is EViews to believe you have 5 minutely data, but it will never believe that as long as you have that "23:59".

Apart from that though, you can create a valid date/time series with the following command:

series datetime = date + @makedate(@floor(time/100), @mod(time,100),"hhmi")

hendrix
Posts: 12
Joined: Thu Mar 25, 2010 6:18 am

Re: Imporing intraday data from Excel

Postby hendrix » Mon Apr 12, 2010 11:02 am

Okei, thank you. I will try some sort of workaround for the 23:59 interval. Maybe if I do a find and replace of all the 2359 values to just 0 in Excel before the import. Will eviews then understand that 0 refers to 00:00?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13586
Joined: Tue Sep 16, 2008 5:38 pm

Re: Imporing intraday data from Excel

Postby EViews Gareth » Mon Apr 12, 2010 11:05 am

It won't automatically pick up the structure, but in two lines you can get EViews happy:

Code: Select all

series datetime = date + @makedate(@floor(time/100), @mod(time,100),"hhmi") pagestruct @date(datetime)

hendrix
Posts: 12
Joined: Thu Mar 25, 2010 6:18 am

Re: Imporing intraday data from Excel

Postby hendrix » Mon Apr 12, 2010 11:09 am

Thank you! I will try this tomorrow and report back :wink:

hendrix
Posts: 12
Joined: Thu Mar 25, 2010 6:18 am

Re: Imporing intraday data from Excel

Postby hendrix » Wed Apr 14, 2010 4:53 am

Works perfect Gareth, one more question:

"smpl 1/28/2009 3/18/2009" returns observations for 1/28/2009 thorugh 3/18/2009. Is it possible to create a sample containing only spesific dates? "smpl if @date= 1/28/2009 and @date=3/18/2009" seems logical but doesn't work. I need it to create dummies on the spesific dates.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13586
Joined: Tue Sep 16, 2008 5:38 pm

Re: Imporing intraday data from Excel

Postby EViews Gareth » Wed Apr 14, 2010 7:19 am

Smpl 1/28/2009 1/28/2009 3/10/2009 3/10/2009

Or something similar

hendrix
Posts: 12
Joined: Thu Mar 25, 2010 6:18 am

Re: Imporing intraday data from Excel

Postby hendrix » Wed Apr 14, 2010 10:54 am

Of course :wink:

hendrix
Posts: 12
Joined: Thu Mar 25, 2010 6:18 am

Re: Imporing intraday data from Excel

Postby hendrix » Fri Apr 30, 2010 5:39 am

What if I want to sample all except specific dates? I have around 100 days I want to exclude from the sample.

tchaithonov
Posts: 168
Joined: Mon Apr 13, 2009 7:39 am
Location: New York City

Re: Imporing intraday data from Excel

Postby tchaithonov » Fri Apr 30, 2010 7:25 am

Just create a dummy variable indicating which obs you need, and then smpl @all if varx = 1.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13586
Joined: Tue Sep 16, 2008 5:38 pm

Re: Imporing intraday data from Excel

Postby EViews Gareth » Fri Apr 30, 2010 8:09 am

Tchaithonov's suggestion is a good one. You can also use @date, along the lines of:

Code: Select all

smpl if @date<@dateval("2009/10/03") and @date>@dateval("2009/11/03")
which would exclude all dates between 3rd October 2009 and 3rd November 2009.

hendrix
Posts: 12
Joined: Thu Mar 25, 2010 6:18 am

Re: Imporing intraday data from Excel

Postby hendrix » Fri Apr 30, 2010 8:16 am

Thanx, works perfect.

hendrix
Posts: 12
Joined: Thu Mar 25, 2010 6:18 am

Re: Imporing intraday data from Excel

Postby hendrix » Tue May 11, 2010 4:37 am

series datetime = date + @makedate(@floor(time/100), @mod(time,100),"hhmi")
Hi again,

Do you have a similar command to get eviews to recognize 1 minute data (see att.)?
Attachments
ex.xlsx
(342.97 KiB) Downloaded 955 times


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests