tensortrade.oms.wallets.ledger module

class tensortrade.oms.wallets.ledger.Ledger[source]

Bases: object

A ledger to keep track of transactions that occur in the order management system.

as_frame(sort_by_order_seq: bool = False) → pandas.core.frame.DataFrame[source]

Converts the ledger records into a data frame.

Parameters:sort_by_order_seq (bool, default False) – If records should be sorted by each order path.
Returns:pd.DataFrame – A data frame containing all the records in the ledger.
commit(wallet: Wallet, quantity: Quantity, source: str, target: str, memo: str) → None[source]

Commits a transaction to the ledger records.

Parameters:
  • wallet (Wallet) – The wallet involved in this transaction.
  • quantity (Quantity) – The amount being used.
  • source (str) – The source of funds being transferred.
  • target (str) – The destination the funds are being transferred to.
  • memo (str) – A description of the transaction.
reset()[source]

Resets the ledger.

class tensortrade.oms.wallets.ledger.Transaction(poid, step, source, target, memo, amount, free, locked, locked_poid)

Bases: tuple

amount

Alias for field number 5

free

Alias for field number 6

locked

Alias for field number 7

locked_poid

Alias for field number 8

memo

Alias for field number 4

poid

Alias for field number 0

source

Alias for field number 2

step

Alias for field number 1

target

Alias for field number 3