When I used Eikon's function StreamingPrice, I tried to pull the value of CF_NETCHNG but got returne

When I used eikon's function StreamingPrice, I tried to pull the value of CF_NETCHNG but got returned NAN instead of 0. For LGOc1-LGOc2 the net change is 0 on screen but in API the value shown is NA it is just a bug in your API that needs to be fixed


na-api.png


Please advised as to why we are getting NAN using the above function but in Eikon, we have 0 values.


Checked this is CODEBK and Eikon Excel - Issue is not replicated. 0 values shows when extracted using these applications, same as quote and MON app


api-and-mon-app.png



Best Answer

  • Jirapongse
    Answer ✓

    @jeremiemae.celajes

    To confirm it, you need to enable the API log when the value is 0. In the log, you will see the retreived data.

    For example, I tested with the /AJA.BK and the value of CF_NETCHNG is 0.
    1705409621466.png

    It displays <NA> in the dataframe.

Answers

  • @jeremiemae.celajes

    Thank you for reaching out to us.

    I can run the code properly.

    1705398500062.png

    You may need to enable logging in the library by using the following code.

    import eikon as ek
    ek.set_log_level(1)
    ek.set_app_key('...')
    ...

  • hi @Jirapongse

    Thanks for the quick turnaround.


    The script the client is using is working however what we are getting is NA values instead of 0 which shows in Eikon MON and quote app.


    I look for a different RIC that have 0 value for NET CHANGE. see the below screenshot


    api-and-quote-app.png


    Instead of getting 0 as values, we are getting NA which is different from the quote app.

  • @jeremiemae.celajes

    I ran the same code on CodeBook and got NA. After checking the log, it is a permission issue.

    1705404406926.png

    Please enable log in the Eikon Data API to verify what the problem is.

    ek.set_log_level(1)
  • Hi @Jirapongse


    Can you confirm why it is a permission issue?

    The reason I ask is because the client and I can get the values using the same code if there is a value aside from 0.

    The only time we get NA is when the values shows 0 in Eikon

    sample-api.png


    I entered ek.set_log_level(1) and I dont see access denied.


    error-api.png

  • @jeremiemae.celajes

    Please run the following code on CodeBook to verify if it is a permission issue.

    import eikon as ek
    ek.set_log_level(1)
    ek.set_app_key('DEFAULT_CODE_BOOK_APP_KEY')
    streaming_prices = ek.StreamingPrices(
        instruments = ['LGOc1-LGOc2'],
        fields = ['CF_NETCHNG'])


    streaming_prices.open()
    df = streaming_prices.get_snapshot()
    streaming_prices.close()
    display(df)

    Then, check for the following log.
    1705405822815.png


  • Hello.

    I ran the same script and I don't get access denied information

    error-api-2.png


  • @jeremiemae.celajes

    Thanks.

    It means that you have permission to access this RIC so you should see the value (2.75) of CF_NETCHNG, not <NA>.


  • @Jirapongse


    Can you confirm if I have the permission and in quote, net change is showing as "0", should I get NA or 0 in API?


    Sample:

    sample-api.png


    As you can see, I get NA in API even the values show as "0" in the quote app.

  • HI @Jirapongse


    To confirm, getting NA is correct?

    NA means that we have 0 values in Eikon, right?

  • @jeremiemae.celajes

    I should display 0, not <NA>.

    I recommend to use the RD Library instead.

    stream = rd.open_pricing_stream(
        universe=['/AJA.BK'],
        fields=['CF_NETCHNG']
    )
    stream.get_snapshot()
  • @Jirapongse


    It is still giving me NA as values. z4-g5.png


    What seems to be the issue?

  • Hi @Jirapongse


    Any update on this please?

  • @jeremiemae.celajes

    That is not the RD library.

    Please check the Content_Pricing_Snapshot.ipynb sample in CodeBook. The sample is in /_Examples/01. Data Retrieval and Discovery/01.01. Refinitiv Data Library/ directory.

  • Hi @Jirapongse


    I was able to review the folder you shared in CODEBK however the issue is it seems Streaming Prices function is not recognizing the -0 or +0 in CODEBK.


    Using the below function, we are able to get 0 values same as in Eikon.


    lcg0c1-lgoc2.png

    Please confirm. Thanks

  • They are different methods so the behaviors are different.