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

__getnewargs__()

Return self as a plain tuple. Used by copy and pickle.

static __new__(_cls, poid, step, source, target, memo, amount, free, locked, locked_poid)

Create new instance of Transaction(poid, step, source, target, memo, amount, free, locked, locked_poid)

__repr__()

Return a nicely formatted representation string

property amount

Alias for field number 5

property free

Alias for field number 6

property locked

Alias for field number 7

property locked_poid

Alias for field number 8

property memo

Alias for field number 4

property poid

Alias for field number 0

property source

Alias for field number 2

property step

Alias for field number 1

property target

Alias for field number 3