godwin

2570871
2570871 Newcomer
edited February 26 in Datastream

Hi,

I am quite new on this platform and I need some assistance.

I currently want to download futures data with the following variables

date
volume

open interest last trading date

time to maturity

ticker symbol

etc

I kindly need assistance on how to go about it

Answers

  • Hi @2570871 ,

    I would suggest starting with something like this article that has tutorial videos to walk you through the Datastream Python API.

    Do keep in mind however that this article uses an old API; DSWS is not live any more, and it was replaced with DatastreamPy. You can find a QuickStart guide here.

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @2570871

    You posted this question on the Datastream forum. Therefore, I assume that you are using the Datastream product.

    The Datastream supports Excel so you can use the Datastream's Excel Add-in to retrieve data.

    image.png

    You can use the Datastream Formula in the Add-in to search for instruments and datatypes.

    The Datastream also supports Python via the DatastreamPy lPython library, as mentioned by my colleague. With this tool, you can use the Datastream Navigator to search for instruments and datatypes.

    However, if you are using Eikon or LSEG Workspace, you can still use Eikon Excel or Workspace Excel to retrieve data.

    Eikon Excel or Workspace Excel provides the Build Formula tool used to generate the Excel's formulas.

    image.png

    Moreover, you can use the LSEG Data Libraries (Python, .NET, and TypeScript) to retrive data via your desktop application. The examples are available on GitHub (Python, .NET, and TypeScript). You can also use the Data Item Browser tool to search for instruments, fields, and parameters available in Eikon or LSEG Workspace.

  • 2570871
    2570871 Newcomer

    Hi Jonathan,

    Thank you for your answer.

    So I did more study, especially with the codebook and the codes available for a start.

    I tried to get the data I want, using the codebook python environment (which I want to fetch, and display before saving in csv format).

    I used the code

    instruments = ['LBS=F']

    fields = ['SETTLE_PRICE'

    parameters = {'SDate': '0CY'

    # Fetch the data

    try:

    print("Fetching data...")

    f

    if err:

    print(f"Error: {err}")

    else:

    # Convert the data to a DataFrame

    df = pd.DataFrame(f)

    print("Data fetched successfully!")

    print(df)

    except Exception as e:

    print(f"An error occurred: {e}")

    but i get this error
    ERROR:pyeikon:HTTP request failed: 'NoneType' object has no attribute 'http_request'
    Fetching data...
    An error occurred: 'NoneType' object has no attribute 'get'


    Any advice please.

  • Hello @2570871

    Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?

    If so please can you click the 'Yes' text next to the appropriate reply? This will guide all community members who have a similar question.
    Thanks,

    AHS

  • 2570871
    2570871 Newcomer

    Hi Wasin,

    Thank you for this.

    Your reply has been very helpful.

    However, I have not yet been able to achieve my goal.

    Perhaps because I am new or I am not getting the RIC definitions right.
    I am open for further assistance or if there are further documentations or videos I can learn how to get futures data including the RIC.

    I will be happy to hear back from you.

    Kind regards

    2570871

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @2570871

    Please share the full runnable code that you are using and paste it in the code block for readability.

    image.png