How to find the maximum daily bid ask spread (for example for Apple)

Hey guys,


I am completely new in Refinitiv Eikon and I really need your support.

Thank your very much!




Best Answer

  • zoya faberov
    zoya faberov ✭✭✭✭✭
    Answer ✓

    Hello @s0568725 ,

    If your interest is in how to find the correct field names to request in Datastream ( i.e. 'P', 'PA', 'PB', etc, you may wish to review the detailed documentation on the available Datastream content at http://product.datastream.com/DswsClient/Docs/ and select option 'DATA TYPES', you will be able to browse and search the list of fields that are available and select per your requirements.

    To get started with Datastream, in Python, the quickest way should be DSWS Python Tutorial , otherwise, select from the available tutorials in the same section.

    Per your requirement, you can request similar to the below via Datastream:

    import DatastreamDSWS as DSWS
    ds = DSWS.Datastream(username =USERNAME, password=PASSWORD)

    df = ds.get_data(tickers='@AAPL';, fields=('PA','PB'), start='-10D', end='-0D', freq='D
    df

    aapl.gif

    and next you can arrive at your requirement, for example, for max SPREAD in the result set:

    df = df.droplevel('Currency', axis=1).droplevel('Instrument', axis=1)

    df['SPREAD'] = df['PA'] - df['PB']

    df[df['SPREAD'] == df['SPREAD'].max()]

    Resulting in:

    maxspread.gif

    As you probably are looking for a different date range, a different or additional calculation based on Datastream content, you can obtain use the same approach to arrive at your exact requirement.

    I hope this information helps

Answers