Comment returnnez-vous les écrans EQS pour une date particulière à l'aide de l'API VBA de Bloomberg?

Je voudrais, pour un écran Bloomberg EQS donné, pouvoir returnner les résultats de l'écran à une date donnée.

J'ai joué avec le file Bloomberg EqsDataExample.xls depuis un moment, mais j'ai été incapable de renvoyer autre chose que l'écran pour la date actuelle.

La fonction Bloomberg utilisée dans une feuille Excel est:

=BEQS(screen_name,"Asof=" & asof_date,) 

Voici la fonction de l'exemple, que j'ai modifiée sans succès. Je présume que je dois faire quelque chose avec la fonctionnalité de substitution, mais ce n'est pas encore là.

 Public Sub MakeRequest(sScreenName As Ssortingng, sScreenType As Ssortingng, sGroup As Ssortingng) Dim req As Request Dim nRow As Long Set req = refdataservice.CreateRequest("BeqsRequest") req.Set "screenName", sScreenName req.Set "screenType", sScreenType 'req.Set "Group", sGroup ' >> My addition, trying to get the asof date override Dim overrides As Element Set overrides = req.GetElement("overrides") Dim override As Element Set override = overrides.AppendElment() override.SetElement "fieldId", "ASOF=" override.SetElement "value", "20101130" 'MsgBox req.Print ' << ' The following code is used to request data for a custom field that is setup ' using EQS <GO> on the Bloomberg Professional service. To use, uncomment these ' next 3 lines of code and comment out the previous 3 lines of code (above) ' Set req = refdataservice.CreateRequest("CustomEqsRequest") ' req.GetElement("fields").AppendValue "#NameOfCustomField" ' Add name of custom field with # prefix ' req.Append "securities", "IBM US Equity" ' Add name of your security ' Add a correlation id Dim cid As blpapicomLib2.CorrelationId ' Send the request Set cid = session.SendRequest(req) curRow = 0 End Sub 

La solution est de configurer fieldId dans "PiTDate" – J'ai trouvé cela dans la documentation de Bloomberg API.

Voici le code qui fonctionne:

 Public Sub MakeRequest(sScreenName As Ssortingng, sScreenType As Ssortingng, sGroup As Ssortingng) Dim req As Request Dim nRow As Long Set req = refdataservice.CreateRequest("BeqsRequest") req.Set "screenName", sScreenName req.Set "screenType", sScreenType 'req.Set "Group", sGroup ' My Code >> Dim overrides As Element Set overrides = req.GetElement("overrides") Dim override As Element Set override = overrides.AppendElment() override.SetElement "fieldId", "PiTDate" override.SetElement "value", "20141130" 'MsgBox req.Print ' << ' The following code is used to request data for a custom field that is setup ' using EQS <GO> on the Bloomberg Professional service. To use, uncomment these ' next 3 lines of code and comment out the previous 3 lines of code (above) ' Set req = refdataservice.CreateRequest("CustomEqsRequest") ' req.GetElement("fields").AppendValue "#NameOfCustomField" ' Add name of custom field with # prefix ' req.Append "securities", "IBM US Equity" ' Add name of your security ' Add a correlation id Dim cid As blpapicomLib2.CorrelationId ' Send the request Set cid = session.SendRequest(req) curRow = 0 End Sub