Bloomberg Link via Formula?

For questions regarding programming in the EViews programming language.

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

kcaron
Posts: 89
Joined: Wed Mar 04, 2015 11:46 am

Bloomberg Link via Formula?

Postby kcaron » Tue Jan 24, 2017 1:16 pm

I need to create dozens of series with links to Bloomberg historic prices in EViews.

Currently, I'm pulling historical prices from Bloomberg into EViews one at a time, but this is very slow.

Ideally, I would like to write a program that creates a series (with an embedded link) via a loop.

Is there a way to write a program for this?

I know I can create a series manually then click on Properties > Values > External Link and manually enter fetch none::"XYZ Equity" and it will work.

It would just be much easier if I could set that value via a command line or program...

I'm using EViews 9.5 Enterprise Edition Dec 27 2016 Build

Thanks!

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

Re: Bloomberg Link via Formula?

Postby EViews Gareth » Tue Jan 24, 2017 1:32 pm

Not entirely sure I know what you're asking, but I think you just need to loop with the fetch command? Fetch has a link option that allows you to fetch as a link.
Follow us on Twitter @IHSEViews

kcaron
Posts: 89
Joined: Wed Mar 04, 2015 11:46 am

Re: Bloomberg Link via Formula?

Postby kcaron » Tue Jan 24, 2017 1:34 pm

Could you give me an example of how I might create a new series via a command line statement that incorporates fetch as link?

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

Re: Bloomberg Link via Formula?

Postby EViews Gareth » Tue Jan 24, 2017 5:23 pm

Code: Select all

fetch(link) nameofseries
Follow us on Twitter @IHSEViews

kcaron
Posts: 89
Joined: Wed Mar 04, 2015 11:46 am

Re: Bloomberg Link via Formula?

Postby kcaron » Thu Jan 26, 2017 2:44 pm

Unfortunately I can't figure out how to do this, even with your example (thank you!)...

Capture.PNG
Capture.PNG (11.31 KiB) Viewed 5896 times


Could you look at this and tell me if there is a way to create a series (using the command line) that will also set the series' external link like this? This would allow me to create a loop program that would let me add 160 series with linked values.

I've literally spent hours on this.

Sorry to bother you with this simple issue...

Kevin

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

Re: Bloomberg Link via Formula?

Postby EViews Gareth » Thu Jan 26, 2017 3:11 pm

The command I gave you does that.
Follow us on Twitter @IHSEViews

EViews Jason
EViews Developer
Posts: 870
Joined: Tue Sep 16, 2008 3:50 pm

Re: Bloomberg Link via Formula?

Postby EViews Jason » Thu Jan 26, 2017 4:18 pm

In order for links to work, the Bloomberg database will need to be in your database registry.
- Select Options->Database Registry and then press the Add new entry button.
- Enter an alias such as bloom
- select Bloomberg from the database type drop down
- enter your login information
- press ok

The following EViews command will then create the desired database link

Code: Select all

fetch(link) bloom::"ctas us equity"

kcaron
Posts: 89
Joined: Wed Mar 04, 2015 11:46 am

Re: Bloomberg Link via Formula?

Postby kcaron » Thu Jan 26, 2017 6:47 pm

Thanks, Gareth!

I got it to create the series in EViews with the link.

But my little program below still doesn't work...


for %i ctas ibm gm

fetch(link) bloom::"{%i} us equity"

next


I imagine this program would insert three new and Bloomberg linked data series into the workfile.

Instead, I get this error:

"Database Error: Bloomberg library error: 'Invalid Security {%I} US EQUITY' in "FETCH(LINK) BLOOM:"{%I} US EQUITY"...

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

Re: Bloomberg Link via Formula?

Postby EViews Gareth » Thu Jan 26, 2017 7:27 pm

Code: Select all

for %i ctas ibm gm

%name = %i + " us equity"
fetch(link) bloom::%name

next
Follow us on Twitter @IHSEViews


Return to “Programming”

Who is online

Users browsing this forum: Bob and 33 guests