Lean  $LEAN_TAG$
QuantConnect.Orders.GroupOrderExtensions Class Reference

Group (combo) orders extension methods for easiest combo order manipulation More...

Static Public Member Functions

static bool TryGetGroupOrders (this Order order, Func< int, Order > orderProvider, out List< Order > orders)
 Gets the grouped orders (legs) of a group order More...
 
static bool TryGetGroupOrdersSecurities (this List< Order > orders, ISecurityProvider securityProvider, out Dictionary< Order, Security > securities)
 Gets the securities corresponding to each order in the group More...
 
static string GetErrorMessage (this Dictionary< Order, Security > securities, HasSufficientBuyingPowerForOrderResult hasSufficientBuyingPowerResult)
 
static decimal GetOrderLegGroupQuantity (this decimal legRatio, GroupOrderManager groupOrderManager)
 Gets the combo order leg group quantity, that is, the total number of shares to be bought/sold from this leg, from its ratio and the group order quantity More...
 
static decimal GetOrderLegRatio (this decimal legGroupQuantity, GroupOrderManager groupOrderManager)
 Gets the combo order leg ratio from its group quantity and the group order quantity More...
 

Detailed Description

Group (combo) orders extension methods for easiest combo order manipulation

Definition at line 27 of file GroupOrderExtensions.cs.

Member Function Documentation

◆ TryGetGroupOrders()

static bool QuantConnect.Orders.GroupOrderExtensions.TryGetGroupOrders ( this Order  order,
Func< int, Order orderProvider,
out List< Order orders 
)
static

Gets the grouped orders (legs) of a group order

Parameters
orderTarget order, which can be any of the legs of the combo
orderProviderOrder provider to use to access the existing orders
ordersList of orders in the combo
Returns
False if any of the orders in the combo is not yet found in the order provider. True otherwise

If the target order is not a combo order, the resulting list will contain that single order alone

Definition at line 37 of file GroupOrderExtensions.cs.

Here is the call graph for this function:

◆ TryGetGroupOrdersSecurities()

static bool QuantConnect.Orders.GroupOrderExtensions.TryGetGroupOrdersSecurities ( this List< Order orders,
ISecurityProvider  securityProvider,
out Dictionary< Order, Security securities 
)
static

Gets the securities corresponding to each order in the group

Parameters
ordersList of orders to map
securityProviderThe security provider to use
securitiesThe resulting map of order to security
Returns
True if the mapping is successful, false otherwise.

Definition at line 82 of file GroupOrderExtensions.cs.

Here is the call graph for this function:

◆ GetOrderLegGroupQuantity()

static decimal QuantConnect.Orders.GroupOrderExtensions.GetOrderLegGroupQuantity ( this decimal  legRatio,
GroupOrderManager  groupOrderManager 
)
static

Gets the combo order leg group quantity, that is, the total number of shares to be bought/sold from this leg, from its ratio and the group order quantity

Parameters
legRatioThe leg ratio
groupOrderManagerThe group order manager
Returns
The total number of shares to be bought/sold from this leg

Definition at line 111 of file GroupOrderExtensions.cs.

◆ GetOrderLegRatio()

static decimal QuantConnect.Orders.GroupOrderExtensions.GetOrderLegRatio ( this decimal  legGroupQuantity,
GroupOrderManager  groupOrderManager 
)
static

Gets the combo order leg ratio from its group quantity and the group order quantity

Parameters
legGroupQuantityThe total number of shares to be bought/sold from this leg, that is, the result of the let ratio times the group quantity
groupOrderManagerThe group order manager
Returns
The ratio of this combo order leg

Definition at line 124 of file GroupOrderExtensions.cs.


The documentation for this class was generated from the following file: