OrderEvent
QuantConnect.Orders.OrderEvent
OrderEvent()
OrderEvent(
order_id: int,
symbol: Union[Symbol, str, BaseContract],
utc_time: Union[datetime, date],
status: OrderStatus,
direction: OrderDirection,
fill_price: float,
fill_quantity: float,
order_fee: OrderFee,
message: str = ...,
)
Bases: Object
Order Event - Messaging class signifying a change in an order state and record the change in the user's algorithm portfolio
Signature descriptions:
-
Order Event empty constructor required for json converter
-
Order Event Constructor.
-
Helper Constructor using Order to Initialize.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
order_id
|
Optional[int]
|
Id of the parent order |
None
|
symbol
|
Optional[Union[Symbol, str, BaseContract]]
|
Asset Symbol |
None
|
utc_time
|
Optional[Union[datetime, date]]
|
Date/time of this event |
None
|
status
|
Optional[OrderStatus]
|
Status of the order |
None
|
direction
|
Optional[OrderDirection]
|
The direction of the order this event belongs to |
None
|
fill_price
|
Optional[float]
|
Fill price information if applicable. |
None
|
fill_quantity
|
Optional[float]
|
Fill quantity |
None
|
order_fee
|
Optional[OrderFee]
|
The order fee |
None
|
message
|
Optional[str]
|
Message from the exchange |
...
|
order
|
Optional[Order]
|
Order for this order status |
None
|
order_id
order_id: int
Id of the order this event comes from.
id
id: int
The unique order event id for each order
utc_time
utc_time: datetime
The date and time of this event (UTC).
fill_price
fill_price: float
Fill price information about the order
fill_price_currency
fill_price_currency: str
Currency for the fill price
fill_quantity
fill_quantity: float
Number of shares of the order that was filled in this event.
absolute_fill_quantity
absolute_fill_quantity: float
Public Property Absolute Getter of Quantity -Filled
message
message: str
Any message from the exchange.
is_assignment
is_assignment: bool
True if the order event is an assignment
stop_price
stop_price: Optional[float]
The current stop price
trigger_price
trigger_price: Optional[float]
The current trigger price
limit_price
limit_price: Optional[float]
The current limit price
quantity
quantity: float
The current order quantity
is_in_the_money
is_in_the_money: bool
True if the order event's option is In-The-Money (ITM)
trailing_amount
trailing_amount: Optional[float]
The trailing stop amount
trailing_as_percentage
trailing_as_percentage: Optional[bool]
Whether the trailing_amount is a percentage or an absolute currency value
clone
clone() -> OrderEvent
from_serialized
from_serialized(
serialized_order_event: SerializedOrderEvent,
) -> OrderEvent
Creates a new instance based on the provided serialized order event
short_to_string
short_to_string() -> str
Returns a short string that represents the current object.
to_string
to_string() -> str
Returns a string that represents the current object.
Returns:
| Type | Description |
|---|---|
str
|
A string that represents the current object. |