Refinitiv Data Library for Python

trade data service stream.on_complete

Called when the stream successfully completes the request and has received all the data.

Module

refinitiv.data.content.trade_data_service

Syntax

stream.on_complete(func)

Parameters

Value Description Data type Optional Default value
func Callable object to process the retrieved data. Callable No -

Returned value

trade data service Stream object

Usage

The following example demonstrates how to display messages received when the stream has successfully completed the request and received all the data.

def func(event, stream):
    current_time = datetime.datetime.now().time()
    print("----------------------------------------------------------")
    print(">>> {} event received at {}".format("Add", current_time))
    print(event)


stream = trade_data_service.Definition(
    universe="LSEG.L",
    fields=["OrderKey", "OrderTime"]
).get_stream()

stream.on_complete(func)
stream.open()

None.