Provides methods for computing a maximum order size.
More...
Provides methods for computing a maximum order size.
Definition at line 27 of file OrderSizing.cs.
◆ GetOrderSizeForPercentVolume()
static decimal QuantConnect.Orders.OrderSizing.GetOrderSizeForPercentVolume |
( |
Security |
security, |
|
|
decimal |
maximumPercentCurrentVolume, |
|
|
decimal |
desiredOrderSize |
|
) |
| |
|
static |
Adjust the provided order size to respect maximum order size based on a percentage of current volume.
- Parameters
-
security | The security object |
maximumPercentCurrentVolume | The maximum percentage of the current bar's volume |
desiredOrderSize | The desired order size to adjust |
- Returns
- The signed adjusted order size
Definition at line 36 of file OrderSizing.cs.
◆ GetOrderSizeForMaximumValue()
static decimal QuantConnect.Orders.OrderSizing.GetOrderSizeForMaximumValue |
( |
Security |
security, |
|
|
decimal |
maximumOrderValueInAccountCurrency, |
|
|
decimal |
desiredOrderSize |
|
) |
| |
|
static |
Adjust the provided order size to respect the maximum total order value
- Parameters
-
security | The security object |
maximumOrderValueInAccountCurrency | The maximum order value in units of the account currency |
desiredOrderSize | The desired order size to adjust |
- Returns
- The signed adjusted order size
Definition at line 51 of file OrderSizing.cs.
◆ GetUnorderedQuantity() [1/2]
Gets the remaining quantity to be ordered to reach the specified target quantity.
- Parameters
-
algorithm | The algorithm instance |
target | The portfolio target |
- Returns
- The signed remaining quantity to be ordered
Definition at line 74 of file OrderSizing.cs.
◆ GetUnorderedQuantity() [2/2]
Gets the remaining quantity to be ordered to reach the specified target quantity.
- Parameters
-
algorithm | The algorithm instance |
target | The portfolio target |
security | The target security |
- Returns
- The signed remaining quantity to be ordered
Definition at line 88 of file OrderSizing.cs.
◆ AdjustByLotSize()
static decimal QuantConnect.Orders.OrderSizing.AdjustByLotSize |
( |
Security |
security, |
|
|
decimal |
quantity |
|
) |
| |
|
static |
Adjusts the provided order quantity to respect the securities lot size. If the quantity is missing 1M part of the lot size it will be rounded up since we suppose it's due to floating point error, this is required to avoid diff between Py and C#
- Parameters
-
security | The security instance |
quantity | The desired quantity to adjust, can be signed |
- Returns
- The signed adjusted quantity
Definition at line 107 of file OrderSizing.cs.
The documentation for this class was generated from the following file: