Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Eikon Data APIs /
avatar image
Question by jaydoubleu79 · Jul 03, 2020 at 09:40 AM · eikon data apistreaming pricetrdvol_1

Streaming prices total volume TRDVOL_1

Hi, I have a question about the streaming prices and the TRD_VOL1 . As it is my understanding the TRD_VOL1 is the volume of the last trade.

I was checking if I get all updates for a security and so the total volume of all updates should be the same as the volume bar in my Eikon terminal. But here it doesnt add up, could you help me out what im doing wrong here?


When I run a streaming prices with the following code:

import eikon as ek
import datetime
ek.set_app_key(xxx)
totalvol=0


def display_updated_fields(streaming_price, instrument_name, fields):
    global totalvol
    current_time = datetime.datetime.now().time()
    totalvol=totalvol+fields['TRDVOL_1']
    print(current_time, "- Update received for", instrument_name, ":", fields)
    print(f' totalvol @ {datetime.datetime.now()} was {totalvol}' )


streaming_prices = ek.StreamingPrices(
    instruments = ['RDSa.AS'],
    fields   = ['TRDVOL_1'],
    on_update = lambda streaming_price, instrument_name, fields :
        display_updated_fields(streaming_price, instrument_name, fields),
)

while True:
    streaming_prices.open()


I get as output:


11:23:56.157812 - Update received for RDSa.AS : {'TRDVOL_1': 169}
 totalvol @ 2020-07-03 11:23:56.157812 was 303
11:23:57.800421 - Update received for RDSa.AS : {'TRDVOL_1': 299}
 totalvol @ 2020-07-03 11:23:57.800421 was 602
11:24:04.215283 - Update received for RDSa.AS : {'TRDVOL_1': 100}
 totalvol @ 2020-07-03 11:24:04.215283 was 702
11:24:30.747384 - Update received for RDSa.AS : {'TRDVOL_1': 63}
 totalvol @ 2020-07-03 11:24:30.747384 was 765
11:24:33.958766 - Update received for RDSa.AS : {'TRDVOL_1': 145}
 totalvol @ 2020-07-03 11:24:33.958766 was 910
11:24:35.233361 - Update received for RDSa.AS : {'TRDVOL_1': 250}
 totalvol @ 2020-07-03 11:24:35.233361 was 1160
11:24:57.402145 - Update received for RDSa.AS : {'TRDVOL_1': 275}
 totalvol @ 2020-07-03 11:24:57.402145 was 1435
11:25:02.335930 - Update received for RDSa.AS : {'TRDVOL_1': 92}
 totalvol @ 2020-07-03 11:25:02.336927 was 1527


So the volume according to the streaming_prices addition is: 1435-602=833 shares

But looking at the Eikon graph it shows 5752 shares for this 11:24 minute.(11:23 was 5719 shares and 11:25 was 6902 shares according to the terminal chart)


So im not getting all updates processed with streaming prices i think. Any idea why im doing this wrong?



thanks!

People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

2 Replies

  • Sort: 
avatar image
Best Answer
Answer by jaydoubleu79 · Jul 03, 2020 at 01:09 PM

I tried on another computer, and there it works fine. So I guess its hardware/software related?

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
Answer by jaydoubleu79 · Jul 03, 2020 at 11:59 AM
13:53:48.831885 - Update received for RDSa.AS : {'TRDVOL_1': 250, 'TRDTIM_1': '11:53:47'}
 totalvol @ 2020-07-03 13:53:48.831885 was 39763
13:54:05.269928 - Update received for RDSa.AS : {'TRDVOL_1': 97, 'TRDTIM_1': '11:54:03'}
 totalvol @ 2020-07-03 13:54:05.269928 was 39860
13:54:05.572120 - Update received for RDSa.AS : {'TRDVOL_1': 60, 'TRDTIM_1': '11:54:04'}
 totalvol @ 2020-07-03 13:54:05.572120 was 39920
13:54:09.616313 - Update received for RDSa.AS : {'TRDVOL_1': 900, 'TRDTIM_1': '11:54:08'}
 totalvol @ 2020-07-03 13:54:09.616313 was 40820
13:54:10.827076 - Update received for RDSa.AS : {'TRDVOL_1': 900, 'TRDTIM_1': '11:54:09'}
 totalvol @ 2020-07-03 13:54:10.827076 was 41720


I did some more testing and as you can see the volume candles from the seconds

13:54:03 & 13:54:04 [ 1100 & 634 shares ]. did not come through the streaming prices, or werent handled.

I only receuved a 97 & 60 share update as one can see from the output.



1593777389216.png (48.0 KiB)
Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
10 People are following this question.

Related Questions

Getting currency code for a security

How to Plot Streaming Data from ek.StreamingPrices?

StreamingPrices limits on Data API

Data fields for the Eikon streaming API

How to get ISIN and RIC for a corresponding Bond ISIN using python Data API ?

  • Feedback
  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Careers
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Calais
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRIT
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • World-Check Data File
  • Explore
  • Tags
  • Questions
  • Badges