Transaction

class qf_lib.backtesting.portfolio.transaction.Transaction(transaction_fill_time: datetime.datetime, ticker: qf_lib.common.tickers.tickers.Ticker, quantity: float, price: float, commission: float, trade_id=None, account=None, strategy=None, broker=None, currency=None)[source]

Bases: object

Encapsulates the notion of a filled Order, as returned from a Brokerage. Stores the quantity of an instrument actually filled and at what price. In addition, stores the commission of the trade from the Brokerage. :param transaction_fill_time: time when the order was filled :type transaction_fill_time: datetime :param ticker: ticker identifying the asset :type ticker: Ticker :param quantity: filled quantity, positive for assets bought and negative for assets sold :type quantity: float :param price: price at which the trade was filled :type price: float :param commission: brokerage commission for carrying out the trade. It is always a positive number :type commission: float