ContingentOrderCache
QuantConnect.Orders.ContingentOrderCache
Bases: Object
Provides a thread-safe service for caching the orders of a set of contingent orders (OCO, OTO, OUO, brackets) until all of them have arrived, so that a brokerage can submit them together. Orders are placed one by one, see GroupOrderCacheManager
try_get_contingent_cached_orders
try_get_contingent_cached_orders(
order: Order, orders: Optional[List[Order]]
) -> Tuple[bool, List[Order]]
Attempts to retrieve all the orders in the set of contingent orders from the cache
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
order
|
Order
|
Target order, which can be any of the orders of the set |
required |
orders
|
Optional[List[Order]]
|
All the orders in the set sorted by id: parents come before the orders they trigger |
required |
Returns:
| Type | Description |
|---|---|
Tuple[bool, List[Order]]
|
True if all the orders of the set were successfully retrieved from the cache, which are removed from it. Otherwise false, the target order is cached for future retrieval. |