Import lists of tickers from excel as strings

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

Young
Posts: 8
Joined: Wed Aug 13, 2014 7:46 am

Import lists of tickers from excel as strings

Postby Young » Wed Aug 13, 2014 9:12 am

Hello

I am relatively new to Eviews (using Eviews 8) and had a really basic question about importing data.

I have an excel spreadsheet (x5.xlsx) in which I have several hundred Haver tickers, plus several fields that contain additional information on the Haver data (one field is the Haver database for the ticker, another is for the frequency, etc.). These fields are used to build up new tickers (let's call the list of these tickers new_tickers). There is a one-for-one mapping of Haver tickers to the new tickers, ie, each Haver ticker has a unique new_ticker. This excel file holds only these two sets of tickers, it does not hold any numerical data. The Haver tickers are on row 2 and my_tickers are on row 1.

I would like to import the Haver tickers into Eviews and then fetch the data using hfetch. I would then like to replace the Haver tickers with the new_tickers, in order to more easily loop through the list of tickers and perform operations on the data, depending on the values of the fields in new_tickers.

I haven't really found a way to do this. If I use wfopen and specify a range that includes only the tickers, I get an error message "No valid observations found in source". If I then make a sort of dummy date range in the excel sheet, the following command will read the data. The Haver tickers are the names of the series, but the "@" symbol in the Haver tickers is replaced by a "_" symbol (why is that?), and the workfile that is created does not have any frequency or date structure (I thought with a dummy date range, Eviews would set up the structure of the workfile automatically).

wfopen x5.xlsx range="Eviews!b1:aj585" colhead = 2 namepos = last

Is there a way to do this? An alternative would be to import the Haver data into the excel worksheet; use wfopen to import the data, and specify the row of my_tickers as namepos, but I would like to avoid using excel as much as possible.

Any advice would be much appreciated.

Thank you very much
Attachments
x5.xlsx
(543.2 KiB) Downloaded 292 times

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

Re: Import lists of tickers from excel as strings

Postby EViews Gareth » Wed Aug 13, 2014 9:36 am

We don't really support doing it the way you're trying to do it.

The best way (and it isn't ideal) is to read the names of the things you want to fetch in as an alpha series on a separate page, then loop through them one at a time.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests