SubmitOrderRequest
QuantConnect.Orders.SubmitOrderRequest
SubmitOrderRequest(
order_type: OrderType,
security_type: SecurityType,
symbol: Union[Symbol, str, BaseContract],
quantity: float,
stop_price: float,
limit_price: float,
trigger_price: float,
trailing_amount: float,
trailing_as_percentage: bool,
time: Union[datetime, date],
tag: str,
properties: IOrderProperties = None,
group_order_manager: GroupOrderManager = None,
asynchronous: bool = False,
)
SubmitOrderRequest(
order_type: OrderType,
security_type: SecurityType,
symbol: Union[Symbol, str, BaseContract],
quantity: float,
stop_price: float,
limit_price: float,
trigger_price: float,
time: Union[datetime, date],
tag: str,
properties: IOrderProperties = None,
group_order_manager: GroupOrderManager = None,
asynchronous: bool = False,
)
SubmitOrderRequest(
order_type: OrderType,
security_type: SecurityType,
symbol: Union[Symbol, str, BaseContract],
quantity: float,
stop_price: float,
limit_price: float,
time: Union[datetime, date],
tag: str,
properties: IOrderProperties = None,
group_order_manager: GroupOrderManager = None,
asynchronous: bool = False,
)
Bases: OrderRequest
Defines a request to submit a new order
Initializes a new instance of the SubmitOrderRequest class. The OrderRequest.order_id will default to OrderResponseErrorCode.UNABLE_TO_FIND_ORDER
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
order_type
|
OrderType
|
The order type to be submitted |
required |
security_type
|
SecurityType
|
The symbol's security_type |
required |
symbol
|
Union[Symbol, str, BaseContract]
|
The symbol to be traded |
required |
quantity
|
float
|
The number of units to be ordered |
required |
stop_price
|
float
|
The stop price for stop orders, non-stop orders this value is ignored |
required |
limit_price
|
float
|
The limit price for limit orders, non-limit orders this value is ignored |
required |
trigger_price
|
Optional[float]
|
The trigger price for limit if touched orders, for non-limit if touched orders this value is ignored |
None
|
trailing_amount
|
Optional[float]
|
The trailing amount to be used to update the stop price |
None
|
trailing_as_percentage
|
Optional[bool]
|
Whether the trailing_amount is a percentage or an absolute currency value |
None
|
time
|
Union[datetime, date]
|
The time this request was created |
required |
tag
|
str
|
A custom tag for this request |
required |
properties
|
IOrderProperties
|
The order properties for this request |
None
|
group_order_manager
|
GroupOrderManager
|
The manager for this combo order |
None
|
asynchronous
|
bool
|
True if this request should be asynchronous, |
False
|
quantity
quantity: float
Gets the quantity of the order
limit_price
limit_price: float
Gets the limit price of the order, zero if not a limit order
stop_price
stop_price: float
Gets the stop price of the order, zero if not a stop order
trigger_price
trigger_price: float
Price which must first be reached before a limit order can be submitted.
trailing_amount
trailing_amount: float
Trailing amount for a trailing stop order
trailing_as_percentage
trailing_as_percentage: bool
Determines whether the trailing_amount is a percentage or an absolute currency value
group_order_manager
group_order_manager: GroupOrderManager
Gets the manager for the combo order. If null, the order is not a combo order.
asynchronous
asynchronous: bool
Whether this request should be asynchronous, which means the ticket will be returned to the algorithm without waiting for submission
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.
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 |
...
|