Upgrade from Eikon -> Workspace. Learn about programming differences.

For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
3 0 1 5

When I used Eikon's function StreamingPrice, I tried to pull the value of CF_NETCHNG but got returned NAN instead of 0

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



eikon-data-api#product
na-api.png (68.8 KiB)
api-and-mon-app.png (90.4 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
Accepted
80.1k 257 52 75

@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.


1705409621466.png (73.3 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

HI @Jirapongse


To confirm, getting NA is correct?

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

Jirapongse avatar image Jirapongse jeremiemae.celajes

@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()
Upvotes
80.1k 257 52 75

@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('...')
...


1705398500062.png (24.3 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
3 0 1 5

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.


api-and-quote-app.png (163.7 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
80.1k 257 52 75

@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)

1705404406926.png (62.0 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

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

sample-api.png (42.8 KiB)
error-api.png (424.2 KiB)
Upvotes
80.1k 257 52 75

@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



1705405822815.png (58.5 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hello.

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

error-api-2.png


error-api-2.png (379.6 KiB)
Jirapongse avatar image Jirapongse jeremiemae.celajes
@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>.


Upvotes
3 0 1 5

@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.


sample-api.png (114.7 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
3 0 1 5

@Jirapongse


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


What seems to be the issue?


z4-g5.png (120.4 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

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.

Upvotes
3 0 1 5

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


lcg0c1-lgoc2.png (18.9 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

They are different methods so the behaviors are different.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.