Trade#
API documentation for tradingstrategy.direct_feed.trade_feed.Trade Python class in Trading Strategy framework.
- class Trade[source]#
Bases:
object
Capture information about single trade.
Designed for technical analysis and trading, prices are not intentionally unit accurate and thus not suitable for accounting.
- __init__(pair, block_number, block_hash, timestamp, tx_hash, log_index, price, amount, exchange_rate)#
Methods
__init__
(pair, block_number, block_hash, ...)filter_buys
(df)Filter buy in trades.
filter_sells
(df)Filter buy in trades.
get_dataframe_columns
()Attributes
Trading pair id.
Block number
Block hash
Block mined at
Block mined at
Trade index within the block
Trade price in quote token
Trade amount in quote token.
The US dollar conversion rate.
- timestamp: Timestamp#
Block mined at
- exchange_rate: Decimal#
The US dollar conversion rate.
You can use this to convert price and amount to US dollars.
- static filter_buys(df)[source]#
Filter buy in trades.
- Parameters:
df (DataFrame) –
- Return type:
DataFrame
- static filter_sells(df)[source]#
Filter buy in trades.
- Parameters:
df (DataFrame) –
- Return type:
DataFrame
- __init__(pair, block_number, block_hash, timestamp, tx_hash, log_index, price, amount, exchange_rate)#