LSEG Data Library for Python

get_stream

Allows you to create a CustomInstrumentsStream object to get streaming data for previously defined instruments.

Module

custom_instruments.Definition

Syntax

definition.get_stream(session)

Parameters

Value Description Data type Optional Default value
session Session object. If session parameters are not defined, the default session will be used. Session object Yes None

Return value

Stream object

Usage

The following example demonstrates how to get the stream object to retrieve BID and ASK fields for EUR= and USD= instruments.

stream = pricing.Definition(
    universe=["S)MyNewInstrument"],
    fields=["BID", "ASK"]
).get_stream()

pricing stream open method
pricing stream close method
pricing stream get_snapshot method
pricing stream add_instruments method
pricing stream remove_instruments method
pricing stream on_refresh method
pricing stream on_update method
pricing stream on_status method
pricing stream on_complete method
pricing stream on_error method

96 words (0:30 mins)