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 ?
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.
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.
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!!!
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.
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!!