TradeDelta#

API documentation for tradingstrategy.direct_feed.trade_feed.TradeDelta Python class in Trading Strategy framework.

class TradeDelta[source]#

Bases: object

Trade history delta for a snapshot

__init__(cycle, start_block, unadjusted_start_block, end_block, start_ts, end_ts, reorg_detected, trades, new_trades)#
Parameters:
  • cycle (int) –

  • start_block (int) –

  • unadjusted_start_block (int) –

  • end_block (int) –

  • start_ts (Timestamp) –

  • end_ts (Timestamp) –

  • reorg_detected (bool) –

  • trades (DataFrame) –

  • new_trades (DataFrame) –

Return type:

None

Methods

__init__(cycle, start_block, ...)

Attributes

cycle

Running counter for each connected client

start_block

New incoming data starting this block.

unadjusted_start_block

end_block

Last block for which we have data

start_ts

Timestamp of the start block

end_ts

Timestamp of the end block

reorg_detected

Did we detect any chain reorgs on this update cycle?

trades

List of individual trades

new_trades

List of trades added in this batch

cycle: int#

Running counter for each connected client

start_block: int#

New incoming data starting this block.

The client might have already data older than > start_block from previous delta. In this case the client needs to purhe this data as it is discarded due to chain reorganisation.

end_block: int#

Last block for which we have data

start_ts: Timestamp#

Timestamp of the start block

end_ts: Timestamp#

Timestamp of the end block

reorg_detected: bool#

Did we detect any chain reorgs on this update cycle?

trades: DataFrame#

List of individual trades

This dataframe is snapped to the given time frame to make candle processing easier, and may contain historical data from the previous cycles.

new_trades: DataFrame#

List of trades added in this batch

__init__(cycle, start_block, unadjusted_start_block, end_block, start_ts, end_ts, reorg_detected, trades, new_trades)#
Parameters:
  • cycle (int) –

  • start_block (int) –

  • unadjusted_start_block (int) –

  • end_block (int) –

  • start_ts (Timestamp) –

  • end_ts (Timestamp) –

  • reorg_detected (bool) –

  • trades (DataFrame) –

  • new_trades (DataFrame) –

Return type:

None