What is the field COUNT and what does it mean when it is assigned with -1?

I am requesting SPY data via API calls - python.

I have seen from a previous question that it means the number of quotes received within the time interval .

However, my issue is that it sometimes returns -1 and sometimes returns NaN. Look what happens when I concatenate the dataframes:



image

Best Answer

  • @fidel.esteves As the thread you mentioned explains - count is mainly used for OTC market instruments - where there is no volume indicated eg FX market and it represents number of quotes. For an exchange traded instrument this is number of trades.

    To get this for SPY you should use an exchange traded primary RIC (SPY.N) using the timeseries call:

    df = ek.get_timeseries('SPY.N') df

    image

    Alternatively, you can use the volume indicator and also the field TR.NUMBEROFTRADES which is available as an end of day series using the get_data function.

    df, err = ek.get_data('SPY.N',['TR.Volume.date','TR.Volume','TR.NUMBEROFTRADES'],{'SDate':'0','EDate':'-10D','FRQ':'D'}) df

    image

    I hope this can help.