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!

Best Answer

  • jaydoubleu79
    jaydoubleu79 Newcomer
    Answer ✓

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

Answers


  • 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

    image


    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.