Eikon COM API in VBA: how to take an action ONLY WHEN all the economic indicators have been publi...

...shed ?
Hey,
I am currently working with the COM Eikon API in VBA and have the following issue: before a macroeconomic indicator is published, its actual value (ECON_ACT) is by default set to 0. I am working with multiple indicators being published at the same time, but since they are sometimes published with a small time difference from one another, I have set an if condition that action is taken only when ALL indicators are not equal to 0 (otherwise action might be taken on the first indicator's notification of release while the others have not been released yet). However, in the case that the actual value of an indicator is actually 0, my if prevents action from being taken.
Any idea how to overcome this ?
Thanks!
Best Answer
-
One way you could do this is instead of checking the value of ECON_ACT field, check field SRC_ES_NS, which provides the time when the actual value for the indicator is published to ECON_ACT field, and which cannot be zero once the indicator value is published.
Another way is to create an array of indicators and boolean values indicating whether the indicator was updated. When you establish the subscriptions and receive initial images for all indicators, set the values of boolean values to false. Then once an indicator receives an update you change the boolean value for that indicator to true. And then when the sum of all boolean values is true you know all indicators have been updated.0
Answers
-
Thanks for your answer!
Would you have any code sample for the array of indicators and boolean values solution ?
Thanks!!
0 -
I just realized boolean type would not be enough, as we need to distinguish 3 states: initial state before the subscriptions are initiated, the subscription returns initial image and raises the first OnUpdate event for the item, an update is received and a second OnUpdate event for the item is raised. An example using Excel VBA is attached. In this example I used integers to encode and distinguish the states.
example.zip0 -
Hey!
Thanks a lot for your answer.
I tried to implement on economic indicators but couldn't seem to make it work..
Really sorry to ask you such precise assistance but could you help me implement the solution in this particular case: actual-value-0-code.zip
Thank you very much!!!
0 -
See attached. In this example I used a custom enum and added comments to make it more illustrative. The problem with using economic indicator RICs in an example is that you cannot test it, except in the live scenario during the release.
actual-value-0-code.zip0 -
Thanks so much!!
I’ll test it and keep you up
0 -
copy-of-actual-value-0-code.zipHey Alex, sorry for the delay and thanks a lot for your answer, it works great for getting non-0 values!
However I am trying to incorporate smartestimate values as well but keep getting errors (check attached), any idea how to do this ??
Thanks a lot!!
0 -
At a quick glance I see two errors in your example:
1. You use string value identical to variable name instead of using the variable.'You have:
.RegisterItems RICs, "FieldName, ForecastFieldName"
'You should have:
.RegisterItems RICs, Array(FieldName, ForecastFieldName)2. Incorrect boundaries in the For loop assigning UserTag property values
'You have:
For i = 1 To NumberOfRICs * 2
'You should have:
For i = 1 To NumberOfRICsThere may be other errors in your example. These are just the two I caught at a quick glance.
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 687 Datastream
- 1.4K DSS
- 623 Eikon COM
- 5.2K Eikon Data APIs
- 11 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 255 ETA
- 557 WebSocket API
- 38 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 276 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 686 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 105 UPA
- 194 TREP Infrastructure
- 229 TRKD
- 918 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 91 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 48 中文论坛