LSEG Data Library for Python

recorder.record

The recorder.record method tarts recording updates from the server and saves them in memory.

Module

lseg.data

Syntax

recorder.record(frequency, duration, ticks_per_bar, on_data)

Parameters

Value Description Data type Optional Default value
frequency Frequency for calculating open-high-low-close (OHLC) values, based on received updates during particular period of time. str Yes "tick"
duration Recording data duration. Values are seconds, minutes, or hours. str Yes None
ticks_per_bar Recorded ticks counter. str Yes "1"
on_data User-defined callback function to process the retrieved data. Callable Yes None

Returned value

None

Usage

The following example demonstrates how to start recording updates from the server for "EUR=" instruments, with "BID", "ASK" and "OPEN_PRC" fields, for a 15-second period:

import lseg.data as ld

stream = ld.open_pricing_stream(universe=['EUR='], fields=['BID', 'ASK', 'OPEN_PRC'])
stream.recorder.record(duration="15s")
102 words (0:32 mins)