dccd.continuous_dl.bitmex.DownloadBitmexData

class dccd.continuous_dl.bitmex.DownloadBitmexData(time_step=60, until=3600)

Basis object to download data from a stream websocket client API.

Parameters:
time_step : int, optional

Number of seconds between two snapshots of data, minimum is 1, default is 60 (one minute). Each time_step data will be processed and updated to the database.

until : int, optional

Number of seconds before stoping or timestamp of when stoping, default is 3600 (one hour).

Attributes:
host : str

Adress of host to connect.

conn_par : dict

Parameters of websocket connection.

ws : websockets.client.WebSocketClientProtocol

Connection with the websocket client.

is_connect : bool

True if is connected, False otherwise.

ts : int

Number of second between two snapshots of data.

t : int

Current timestamp but rounded by ts.

until : int

Timestamp to stop to download data.

Methods

set_process_data(self, func, \*\*kwargs) Set processing function.
set_saver(self, call, \*\*kwargs) Set saver object to save data or update a database.
__call__(self, \*args) Open a websocket connection and save/update the database.