Skip to main content
Version: Python

Replayer

Replayer is used to replay historical data with timestamps in a new, in-memory table.

Syntax

Replayer(startTime, endTime)

Parameters

ParameterTypeDescription
startTimeDateTime

Historical data start time

endTimeDateTime

Historical data end time.

Returns

A Replayer object that can be used to replay historical data.

Methods

Replayer supports the following methods:

Example

The following example creates some fake historical data with timestamps and then replays it.

from deephaven import new_table
from deephaven.column import datetime_col, int_col
from deephaven.replay import TableReplayer
from deephaven.time import to_datetime

import jpy

result = new_table([
datetime_col("DateTime", [to_datetime("2000-01-01T00:00:01 NY"), to_datetime("2000-01-01T00:00:03 NY"), to_datetime("2000-01-01T00:00:06 NY")]),
int_col("Number", [1, 3, 6])
])

startTime = to_datetime("2000-01-01T00:00:00 NY")
endTime = to_datetime("2000-01-01T00:00:07 NY")

resultReplayer = TableReplayer(startTime, endTime)

replayedResult = resultReplayer.add_table(result, "DateTime")

resultReplayer.start()