Is it possible to fetch Bloomberg data using Q?

471 views
Skip to first unread message

Wei Li

unread,
Nov 9, 2011, 5:19:24 AM11/9/11
to Kdb+ Personal Developers

Is it possible to fetch Bloomberg data using Q? If so, can you give a
simple example such at to get the close price of Google?
Thanks!

Attila Vrabecz

unread,
Nov 9, 2011, 10:00:30 AM11/9/11
to personal...@googlegroups.com
http://kx.com/q/c/feed/bb.c

compiled for win32:
http://kx.com/q/w32/bb.dll
  Attila

> --
> You received this message because you are subscribed to the Google Groups "Kdb+ Personal Developers" group.
> To post to this group, send email to personal...@googlegroups.com.
> To unsubscribe from this group, send email to personal-kdbpl...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/personal-kdbplus?hl=en.
>
>

Wei Li

unread,
Nov 10, 2011, 12:37:08 AM11/10/11
to Kdb+ Personal Developers
Hi Attila,
Thanks for the reply.
How to use that dll? Can you please give an example?

Patryk Bukowinski

unread,
Nov 10, 2011, 2:12:35 AM11/10/11
to personal...@googlegroups.com

http://code.kx.com/wiki/Reference/TwoColon

Appreciate, no one yet mention you to first use search on kx wiki.
;-)

Charles Skelton

unread,
Nov 10, 2011, 5:32:52 AM11/10/11
to personal...@googlegroups.com

Wei Li

unread,
Nov 10, 2011, 10:28:41 AM11/10/11
to Kdb+ Personal Developers

Thanks guys for the reply.
As a beginner of q, I do not know how to run the examples above. I
tried

>q tick/bb.q localhost:1234

but failed. I copied bbq to c:\q\tick\

Can you please give more details such as do I need to download some
other files from http://kx.com/q/tick or other sites? and put them in
which directory? My q is in C:\q
And can you please also provide the commands to run bb.q and the
example to query a stock close price from BBG? does it depend on other
files?

I think other beginners may have the same question as me and a full
instruction will be very helpful.
Thanks a lot

On Nov 10, 6:32 pm, Charles Skelton <char...@kx.com> wrote:
> http://kx.com/q/tick/bb.qhttp://kx.com/q/tick/bb.txt

Aaron Davies

unread,
Nov 11, 2011, 9:23:03 PM11/11/11
to personal...@googlegroups.com
On Nov 9, 2011, at 5:19 AM, Wei Li wrote:

> Is it possible to fetch Bloomberg data using Q? If so, can you give a
> simple example such at to get the close price of Google?

do you have a bb subscription?

Wei Li

unread,
Nov 12, 2011, 2:14:47 AM11/12/11
to Kdb+ Personal Developers
Yes, I have

Wei Li

unread,
Nov 14, 2011, 9:09:34 AM11/14/11
to Kdb+ Personal Developers
Any more advise on this?

Aaron Davies

unread,
Nov 14, 2011, 10:55:55 PM11/14/11
to personal...@googlegroups.com
>>> Is it possible to fetch Bloomberg data using Q? If so, can you give a simple example such at to get the close price of Google?
>>
>> do you have a bb subscription?
>
> Any more advise on this?

what's your actual problem?

(btw i've never used bb w/q myself, only reuters, and that was quite a while ago)

Wei Li

unread,
Nov 15, 2011, 8:09:00 AM11/15/11
to Kdb+ Personal Developers
My actual problem as listed above is how to fetch BBG data in q?

Felix LUNGU

unread,
Nov 15, 2011, 10:54:10 AM11/15/11
to personal...@googlegroups.com
you need access to a bloomberg terminal of a data server first.
once you have that, you can start playing with the data.

so, do you have any of the above?


2011/11/15 Wei Li <lav...@gmail.com>:

Wei Li

unread,
Nov 16, 2011, 12:38:07 AM11/16/11
to Kdb+ Personal Developers

Aaron Davies

do you have a bb subscription?

Wei Li

Yes, I have

--------------------------------------------------------------------------------
As Aaron asked and I replied, YES I HAVE!

Jack Andrews

unread,
Nov 16, 2011, 10:19:16 PM11/16/11
to personal...@googlegroups.com
hi wei,

can you run this?

sub:`bb 2:(`sub;`sym)

with bb.dll ?

ta, jack.

GarryHolmer

unread,
Dec 7, 2011, 8:05:39 AM12/7/11
to Kdb+ Personal Developers
Hi Guys,
I have access to Bloomberg, but i still cannot retrieve Data using Q.

Could you please describe the steps for an absolute beginner? (Step 1,
Step 2, Step 3....etc)

I have saved the bb.dll file in C:\WINDOWS\system32 and tried to run
it by regsvr32 bb.dll.
I get the following error message - LoadLibrary("bb.dll") failed -
The specific module could not be found.


Thanks in advance!

GarryHolmer

On 17 Nov., 04:19, Jack Andrews <effb...@gmail.com> wrote:
> hi wei,
>
> can you run this?
>
>   sub:`bb 2:(`sub;`sym)
>
> with bb.dll ?
>
> ta, jack.
>
>
>
> On Wed, Nov 16, 2011 at 4:38 PM, Wei Li <lavi...@gmail.com> wrote:
>
> > Aaron Davies
>
> > do you have a bb subscription?
>
> > Wei Li
>
> > Yes, I have
>

> > ---------------------------------------------------------------------------­-----


> > As Aaron asked and I replied, YES I HAVE!
>
> > --
> > You received this message because you are subscribed to the Google Groups "Kdb+ Personal Developers" group.
> > To post to this group, send email to personal...@googlegroups.com.
> > To unsubscribe from this group, send email to personal-kdbpl...@googlegroups.com.

> > For more options, visit this group athttp://groups.google.com/group/personal-kdbplus?hl=en.- Zitierten Text ausblenden -
>
> - Zitierten Text anzeigen -

Jack Andrews

unread,
Dec 7, 2011, 7:43:40 PM12/7/11
to personal...@googlegroups.com
1   ensure you have bbapi.dll in your path (should be included in your bb client)
2   put bb.dll in %QHOME%/w32 (eg: c:\q\w32) or c:\windows\system32
3   start q
4   q)sub:`bb 2:(`sub;1)
5   q)sub x

i don't have bb access, so i can't  test this.  the x on the last line is a symbol.  i assume it is something like `C:US .  

also, i think sub registers a callback so it handles data coming down the line in the event loop.  i haven't looked close enough to tell you where bb.dll puts the incoming data.  and i haven't used callbacks before, so i'm doubly blind :j

i suspect you may need to define q functions mon, stt and upd to handle the data as q receives it.  

could be a good article to put on the wiki once we work out how to do it!

GarryHolmer

unread,
Dec 14, 2011, 9:09:49 AM12/14/11
to Kdb+ Personal Developers
Hi Jack,

Thank you very much for your detailed answer! it helped me to get
started.
an article on wiki sounds like a great idea. I am sure that there are
many people around who would benefit from such article.

what is, for example, missing is how to get close prices or other
information from Bloomberg.

Does anybody know how to build such functions in order to get closing
prices from Bloomberg? It is still, unfortunately, a black box for
me.

Harry Holmer

On 8 Dez., 01:43, Jack Andrews <effb...@gmail.com> wrote:
> 1   ensure you have bbapi.dll in your path (should be included in your bb
> client)
> 2   put bb.dll in %QHOME%/w32 (eg: c:\q\w32) or c:\windows\system32
> 3   start q
> 4   q)sub:`bb 2:(`sub;1)
> 5   q)sub x
>
> i don't have bb access, so i can't  test this.  the x on the last line is a
> symbol.  i assume it is something like `C:US .
>
> also, i think sub registers a callback so it handles data coming down the
> line in the event loop.  i haven't looked close enough to tell you where
> bb.dll puts the incoming data.  and i haven't used callbacks before, so i'm
> doubly blind :j
>
> i suspect you may need to define q functions mon, stt and upd to handle the
> data as q receives it.
>
> could be a good article to put on the wiki once we work out how to do it!
>

Reply all
Reply to author
Forward
0 new messages