Introduction
With the Macrobond add-in for EViews you can load series from the Macrobond database, and you can store series to the Macrobond account in-house database from EViews.
Requirements
You need to have Macrobond and EViews 7.2 Enterprise Edition (Apr 29, 2011 build) or later. If you are running the 64-bit version of EViews, you need the 64-bit version of Macrobond. Note that only EViews Enterprise Edition can connect to external data sources - other versions of EViews won't be able to connect due to EViews restrictions regarding 3rd party vendors.
This API can be used only with Legacy or Data+ license.
Getting started
The first time you start EViews after installing the required versions of both Macrobond and EViews, you will be asked if you want to register the Macrobond add-in. To be able to use the add-in, you should answer Yes to this question
Once the Macrobond add-in is registered, you will see the Macrobond Database in the list of databases shown when you select File|Open|Database in EViews:
To open the database, just press OK in this dialog
Working with EViews add-in
Manually registering and unregistering the add-in
The Macrobond add-in by default registers automatically but in case it fails, you can manually register add-in for EViews by executing this command in EViews:
edxadd Abacus.EViewsDBManager
You can unregister the add-in with this command:
edxdrop Abacus.EViewsDBManager
Reading data into EViews
You can add series to the list of series presented in the Macrobond database window in EViews by pressing the Browse or Browse-append buttons. These commands will display the Macrobond 'Select time series' dialog:
You can pick one or more series to add to your database view in EViews.
You can now work with these series like series from any other external data source in EViews. The most common operation is to export them to a Workfile. You can do this from the Object or context menu in EViews.
Storing data from EViews
You can store time series in EViews to the 'Account in-house database' in Macrobond. The time series will then be available in the Macrobond application.
To store a time series you can do 'Store to DB…' from the Object menu or context menu when you have selected a time series in EViews. You may also use drag and drop and drop the series in a Macrobond Database window in EViews.
If more information is required in order to store the series in Macrobond, a dialog like this will be displayed:
When all information is filled in and you press OK, the series will then be stored.
In order to avoid this dialog, which is useful when automating tasks, you can complement the series in EViews with some additional attributes: Name, Macrobond_category, Macrobond_region, Macrobond_ihdatabase. See section Labels below. No dialog will be displayed when all these attributes are present.
In EViews you can specify these attributes in the View|Label view of a series:
Note: You enter new labels on the empty line above the 'Remarks:' label.
You can see hints for these attributes in the dialog where you enter complementary series information:
If you have the Macrobond application running when you save a new series to the Macrobond database in EViews, you might need to press the refresh button in Macrobond in order to see the new series in the list.
Labels
The following labels are used by the Macrobond add-in:
Name | The name of the series in Macrobond. |
Description | This is the description of the series in Macrobond. |
Remarks | A comment about the series. |
Convert_HiLo Convert_LoHi |
For series that have Class = "Flow", these are Convert_HiLo=sum and Convert_LoHi=const_s. Otherwise they are Convert_HiLo=last and Convert_LoHi=const_a. |
Macrobond_category | The Macrobond category of the series. For example, the value could be "Wages". |
Macrobond_region | The country or region code of the series when stored in Macrobond. This must be an existing region. The codes are based on two letter ISO 3166 codes. You can find a complete list of the supported regions at https://www.macrobond.com/go/regionList. |
Macrobond_ihdatabase | This attribute tells Macrobond where the series is stored. It can be 'mb:priv', 'mb:com' or 'mb:lib'. |
Macrobond_forecaststartdate | If present, all values from this date forward are forecasts. The date format is yyyy-MM-dd. For example: 2012-06-15 |
Macrobond_releasestage | If present, indicates the status of the last value in the series. Can be one of advance, preliminary or final. |
Macrobond_currency | The currency of the series, if any. This is the three letter ISO 4217 code. You can get a list of the supported countries at The Currency List |
Last_update | If present, indicates when the series was last updated. The format is yyyy-MM-ddTHH:mm:ss. For example: 2012-08-20T15:00:00 |
Next_update | If present, indicates when the series is scheduled to be updated the next time. The format is yyyy-MM-ddTHH:mm:ss. For example: 2012-08-20T15:00:00 |
Source | The source of the data. |
Units | The unit of the data. |
Using EViews commands
You can use commands in EViews to download series from any source, including Macrobond. Assuming that you have defined a database alias called 'mb' for the Macrobond database, you can use a command like this:
fetch(d=mb) gold
or
fetch mb::gold
You can download several series with one command:
fetch(d=mb) gold silver
In order to be able to update the series in the workbook you need to create a link:
fetch(d=mb,link) gold
If the Macrobond series name contains spaces, you need to put the identifier within quotes. For example, to download a series from Bloomberg:
fetch(d=mb,link) "ih:bl:ibm us equity"
To store a time series you use the EViews 'store' command, which works in a similar way to 'fetch':
store(d=mb) myseries1
To set labels, you use the 'label' function:
myseries1.label(Macrobond_region) us myseries1.label(Macrobond_category) Wages myseries1.label(Macrobond_ihdatabase) mb:priv store(d=mb) myseries1