Volume becomes N/A when you adjust the end date.

Replicated the code and notice that the issue is replicable:

The Last day becomes N/A for March 29, 2004, when we adjust the end date to March 30,2004 then the 29 has value and the N/A moves to the day 30.

Here is the code try changing the End date into march 29, 2004 then 30 and then 31


import refinitiv.data as rd

rd.open_session()
df = rd.get_data(

universe = ['AAPL.O'],

fields = ['TR.CLOSEPrice', 'TR.LOWPrice', 'TR.CLOSEPRICE.DATE', 'TR.Volume.Date', 'TR.VOLUME', 'TR.NUMBERBLOCKTRADES', 'TR.TSVWAP'],
parameters = {'SDate': '2004-03-25', 'Edate': '2004-03-31'}

)

display(df)

Best Answer

  • Jirapongse
    Answer ✓

    @marceugene.belen

    Thank you for reaching out to us.

    I checked the data in Workspace Excel and found that it doesn't return the TR.Volume on 2004-03-29.

    1718077143128.png

    The output is similar to RD library.

    1718077542642.png

    The TR.ClosePrice and TR.Volume fields are in different categories. The TR.ClosePrice field is in the Time Series category while the TR.Volume field is in the Price and Volume History category.

    You may try to use the TR.AccumulatedVolume field which is in the Time Series category.

    df = rd.get_data(
        universe = ['AAPL.O'],
        fields = ['TR.CLOSEPrice', 'TR.LOWPrice', 'TR.CLOSEPRICE.DATE', 'TR.AccumulatedVolume.Date', 'TR.AccumulatedVolume', 'TR.NUMBERBLOCKTRADES', 'TR.TSVWAP'],
        parameters = {'SDate': '2004-03-25', 'Edate': '2004-03-31'}
    )


    df

    You can check the available fields and categories via the Data Item Browser tool or Formula Builder in Workspace Excel.