UpdateOrderRequest
QuantConnect.Orders.UpdateOrderRequest
UpdateOrderRequest(
time: Union[datetime, date],
order_id: int,
fields: UpdateOrderFields,
)
Bases: OrderRequest
Defines a request to update an order's values
Initializes a new instance of the UpdateOrderRequest class
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
Union[datetime, date]
|
The time the request was submitted |
required |
order_id
|
int
|
The order id to be updated |
required |
fields
|
UpdateOrderFields
|
The fields defining what should be updated |
required |
quantity
quantity: Optional[float]
Gets the new quantity of the order, null to not change the quantity
limit_price
limit_price: Optional[float]
Gets the new limit price of the order, null to not change the limit price
stop_price
stop_price: Optional[float]
Gets the new stop price of the order, null to not change the stop price
trigger_price
trigger_price: Optional[float]
Gets the new trigger price of the order, null to not change the trigger price
trailing_amount
trailing_amount: Optional[float]
The trailing stop order trailing amount
time
time: datetime
Gets the UTC time the request was created
order_id
order_id: int
Gets the order id the request acts on
tag
tag: str
Gets a tag for this request
response
response: OrderResponse
Gets the response for this request. If this request was never processed then this will equal OrderResponse.UNPROCESSED. This value is never equal to null.
is_allowed_for_closed_order
is_allowed_for_closed_order() -> bool
Checks whether the update request is allowed for a closed order. Only tag updates are allowed on closed orders.
Returns:
| Type | Description |
|---|---|
bool
|
True if the update request is allowed for a closed order. |
to_string
to_string() -> str
Returns a string that represents the current object.
Returns:
| Type | Description |
|---|---|
str
|
A string that represents the current object. |
set_response
set_response(
response: OrderResponse,
status: OrderRequestStatus = ...,
) -> None
Sets the response for this request
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
response
|
OrderResponse
|
The response to this request |
required |
status
|
OrderRequestStatus
|
The current status of this request |
...
|