CQG POSITIONBRKT – Position Bracket.
Order types: LMT
Available only for instruments for which both Limit and Market orders are available at the destination Exchange.
Method: Implements Bracket behavior using up to three targets for profit (each is a Limit order) and one stop (implemented as triggered limit order).
This algo may be used to create new position but is assumed to be used to manage an existing position.
All orders launched by the algo will be on the side of CQG POSITIONBRKT order.
Parameters:
Name |
Tag number |
Format |
Comment |
TargetStrategy |
847 |
Int |
1018 - CQG POSITIONBRKT |
StopTicks |
9602 |
Int |
Number of ticks away from algo order price (higher for BUY, lower for SELL) to calculate price which when reached will result in launching ‘stop’ part of the algo. Default – 0. Shall be greater than or equal to 0. |
Target1PriceTicks |
9610 |
Int |
Number of ticks away from algo order price (lower for BUY, higher for SELL) to determine price of first profit target order. Default – 0. Shall be greater than or equal to 0. |
Target1QtyPct |
9611 |
Float |
Percentage of algo order’s quantity to allocate to quantity of first profit target. Default – 0. Value range is [0.0; 1.0]. That parameter cannot be updated – algo will be terminated on attempt to change its value. |
Target2PriceTicks |
9612 |
Int |
Number of ticks away from algo order price (lower for BUY, higher for SELL) to determine price of second profit target order. Default – 0. Shall be greater than or equal to 0. |
Target2QtyPct |
9613 |
Float |
Percentage of algo order’s quantity to allocate to quantity of second profit target. Default – 0. Value range is [0.0; 1.0]. That parameter cannot be updated – algo will be terminated on attempt to change its value. |
Target3PriceTicks |
9614 |
Int |
Number of ticks away from algo order price (lower for BUY, higher for SELL) to determine price of third profit target order. Default – 0. Shall be greater than or equal to 0. |
Target3QtyPct |
9615 |
Float |
Percentage of algo order’s quantity to allocate to quantity of third profit target. Default – 0. Value range is [0.0; 1.0]. That parameter cannot be updated – algo will be terminated on attempt to change its value. |
Depending on CQG POSITIONBRKT algo order side it distributes its quantity for up to three BUY or SELL (BUY side algo will send BUY side children, not both sides; same logic applies to SELL side algo order) profit target orders at the prices better than order’s price but will try to execute its remaining quantity if market worsens (moves in a worse direction for a number of stop ticks).
Profit target quantity distribution
Sum of Target1QtyPct, Target2QtyPct and Target3QtyPct shall be 1.0 or algo order will be rejected.
It is not required to specify all three profit targets parameters but target quantity percentage sum still shall be 1.0 so if only one profit target needs to be launched value of corresponding percentage parameter shall be 1.0.
Algo uses ‘greedy’ logic when allocating its quantity to profit targets: the target with higher quantity percent gets it first, then come targets with lower quantity percent. If there are two targets with equal quantity percent then quantity is allocated to profit targets in numeric order.
For example, if algo order quantity is 1 and there are two profit targets both having 0.5 as their corresponding quantity percent, then there will be a 1 lot Limit order sent to destination Exchange for first target, and no orders for second target.
Quantity allocated to targets is rounded to a closest integer value. For example, if order size is 9 and there are 2 targets with 0.5 quantity percent then first one will get 5 lots, second – 4 lots. If order size is 9 and there are three targets with 0.33, 0.33 and 0.34 quantity percent correspondingly, each one will result in a Limit order for 3 lots.
Currently it is not allowed to change quantity percent values for profit targets.
Update of algo quantity may result in cancellation of Limit orders corresponding to profit targets if newly allocated profit target quantity becomes equal to a quantity already filled for that target.
Child order price calculation
CQG POSITIONBRKT algo order’s limit price, let it be P, is used as starting point for all price calculations.
Let the order contract tick size be T.
1. BUY CQG POSITIONBRKT:
a. Target1Price = P – Target1PriceTicks * T
b. Target2Price = P – Target2PriceTicks * T
c. Target3Price = P – Target3PriceTicks * T
d. StopPrice = P + StopTicks * T.
2. SELL CQG POSITIONBRKT
a. Target1Price = P + Target1PriceTicks * T
b. Target2Price = P + Target2PriceTicks * T
c. Target3Price = P + Target3PriceTicks * T
d. StopPrice = P - StopTicks * T.
Example: let’s consider a situation when there’s 100 lots long position in E-Mini Futures.
Let P = 5988.00; T = 0.25.
A trader wants to sell 100 lots of EP in 50/50% proportion at 5989.00 and 5989.50 for first and second targets correspondingly..
Trader also wants to sell order’s remaining quantity if market moves below 5986.00
To achieve those results it’s will be needed to send an LMT DAY CQG POSITIONBRKT algo for 100@5988.00 with:
1. StopTicks = 8
2. Target1PriceTicks=4, Target1QtyPct=0.5
3. Target2PriceTicks=6, Target1QtyPct=0.5.
SELL LMT DAY CQG POSITIONBRKT algo with such parameters launch two children: 50@5989.00 and 50@5989.50.
But if market price moves to 5986.00 quantity which was not filled for child orders will be launched as MKT DAY order.