Skip to content

Trade

QuantConnect.Statistics.Trade

Bases: Object

Represents a closed trade

symbol

symbol: Symbol

The symbol of the traded instrument

entry_time

entry_time: datetime

The date and time the trade was opened

entry_price

entry_price: float

The price at which the trade was opened (or the average price if multiple entries)

direction

direction: TradeDirection

The direction of the trade (Long or Short)

quantity

quantity: float

The total unsigned quantity of the trade

exit_time

exit_time: datetime

The date and time the trade was closed

exit_price

exit_price: float

The price at which the trade was closed (or the average price if multiple exits)

profit_loss

profit_loss: float

The gross profit/loss of the trade (as account currency)

total_fees

total_fees: float

The total fees associated with the trade (always positive value) (as account currency)

mae

mae: float

The Maximum Adverse Excursion (as account currency)

mfe

mfe: float

The Maximum Favorable Excursion (as account currency)

duration

duration: timedelta

Returns the duration of the trade

end_trade_drawdown

end_trade_drawdown: float

Returns the amount of profit given back before the trade was closed

is_win

is_win: bool

Returns whether the trade was profitable (is a win) or not (a loss)

order_ids

order_ids: HashSet[int]

The IDs of the orders related to this trade