Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Has anyone used the Bloomberg Data Control?
Message
De
18/03/2003 18:13:42
Bill Drew
Independent Consultant
Chicago, Illinois, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00736028
Message ID:
00767308
Vues:
15
Been having some success. Not always easy to get away from other tasks and get onto a machine with a bloomberg license. But now I can monitor a table of request for data elements and ship off two arrays (one of securities and the other of fields required). The results are back in a matter of seconds.

Here is what I did: sense the arrival of a new record in a table of requests by running a daemon type do whil .t. loop in a prg. (The trading system is written in 2.6 so there in still a lack of integration. When an unsatisfied request arrives, I call a form that has the data control on it. Make sure to make it modal because the data control is asynchronous. I haven't figured out how to instantiate that control outside of dragging it onto the form because there is custom method code in the "data event".

Here is the key command to this control. I put it in the init event of the form.
PROCEDURE Init
LPARAMETERS tCusip, tWhere
SELECT UPPER(TRIM(BLM_Field)) FROM api_info &tWhere INTO ARRAY vtFields
*DOESN'T SEEM TO WORK WITH ACTIVATEREALTIME SET TO .F.
thisform.blpdata1.object.activaterealtime = .T.
* ONLY GETS ONE RESULT IF SUBSCRIPTIONMODE IS 1
ThisForm.blpdata1.object.SubscriptionMode = 0
STORE UPPER(TRIM(tCusip)) TO VTSECURITY(1)
FOR I = 1 TO ALEN(VTFIELDS,1)
thisform.BlpData1.object.Subscribe(@vtSecurity, I,vtFields(i))
endf

Note how you have to use .object before you can get to methods of this object.

I release the form in the "data event" when I have detected that all of the requested data elements have been returned.

PROCEDURE DATA
*** ActiveX Control Event Handler ***
LPARAMETERS security, cookie, fields, data, status
SELECT API_INFO
SEEK VTFIELDS(COOKIE)
IF FOUND()
REPLACE BDATA WITH IIF(TYPE("DATA") ="N",STR(DATA),DATA)
ENDIF
IF COOKIE = ALEN(VTFIELDS,1)
THISFORM.Release()
ENDI
ENDPROC

Hope this helps.
Still a ways to go in making it more unified and streamlined.
The point is it works. You need to know the mnemonics for the fields and of course the security identifier.

Kind of a drag that the control tries to connect to Bloomberg even in design mode so it isn't really practical to develop the app except on a BB licenced machine -- unless I figure out how to instantiate the object without even using the form.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform