- Using Attached Orders and Attached Order Settings
- Sending Attached Orders Independently
- Changing Attached Orders Configuration After Parent Order Sent
- Using Single Common Stop
- Attached Orders Examples
- Scaling Out
- Scaling In
- Hiding Attached Orders on Chart until Parent Fill
- Study Controlled Targets and Stops
- Potential Conditions Which Can Lead to Attached Orders Not Functioning As Expected in Live Trading
- Using Attached Orders with Attached Orders
- Unable to Modify Price of Attached Orders
- Using DTC Server Feature for Reliable Server-Side Attached Orders
Attached Orders are orders which are attached to the main order being submitted. These Attached Orders function as price Targets and/or Stops. Most any combination of Attached Orders can be specified to be attached to the main order.
The primary order entered is known as a Parent order and all Attached Orders are known as Child Orders or Attached Orders.
The Attached Orders are always the opposite of the parent. For example, if the parent order is a Buy order, all the Attached Orders associated with it will be Sell orders.
When there is a Stop and a Target attached orders attached to a Parent order, these orders are in an OCO group. OCO stands for Order Cancels Order.
A simple example of a Parent order with an attached Stop and Target order is commonly known as a bracket order.
You can have as little as one Attached Order or many. The relationship between the Attached Orders or Child orders themselves are known as siblings.
When there are Attached Orders defined and active, on the Trade Window for a chart or Trade DOM, and you enter an order from that Trade Window or from the associated chart or Trade DOM, these Attached Orders will then be attached to the parent order if they are enabled to be used.
General Management of Attached Orders
The information in this subsection explains the management of Attached Orders when the Trading service does not support server-side OCO orders or server-side Bracket orders. This information also applies to orders entered when Sierra Chart Trade Simulation Mode is on.
When a Parent order is submitted, the Attached Orders remain inactive and have a Quantity of 0.
When a parent order is filled, the Attached Orders will become active and at that time are sent to the connected Trading service if Trade Simulation Mode is disabled. Or are processed by the Sierra Chart Trade Simulation system, if Trade Simulation Mode is enabled.
The order quantity of the Attached Orders will be equal to the quantity of the parent order.
Until the parent fills, the Attached Orders will be inactive and held within Sierra Chart. They will not be sent to the connected Trading service until there is a fill or partial fill of the parent order.
When the Attached Orders are held within Sierra Chart in the case when the server does not support server-side Bracket orders or the option to use that is disabled, this is indicated on the Order Confirmation as shown below.
When the Attached Orders are active and the Limit or Stop price for an Attached Order is reached and one of the orders is fully filled, then the other Attached Order, if there is one, in the same OCO (Order Cancels Order) group will be canceled by Sierra Chart.
Partial fills are managed as well. When the Parent order partially fills, the Attached Orders will be activated to the quantity of the parent order fill. Likewise, if there is a partial fill of one of the Attached Orders, then the other Attached Order in the same OCO group will have its quantity adjusted down by the amount of the fill rather than being canceled.
Once the Attached Order set is sent to the connected Trading service, it will still be active even if Sierra Chart loses connectivity to the Trading service. In the case where your Trading service does not support server-side OCO functionality and Sierra Chart is managing that functionality on your local computer, then those Attached Orders will not have OCO functionality if connectivity is lost to your Trading service.
Management of Attached Orders when Trading Service Supports Server-side OCO Only
In the case of when the trading service you are using supports server-side OCO, the information in the General Management of Attached Orders applies except for the following:
The Canceling and Quantity adjustment of the other Attached Order in an OCO Group is handled by the Trading service and not Sierra Chart when the other Attached Order (sibling) fills or partially fills.
If a Trading service supports server-side OCO, it is necessary to enable server-side OCO functionality within Sierra Chart by enabling Global Settings >> General Trade Settings >> Use Server-Side OCO and Bracket Orders for it to be used.
How do you know whether your Trading service supports OCO functionality? If your Trading service does not provide OCO functionality, then this functionality will be provided by Sierra Chart. You will know if your Trading service supports OCO functionality when you submit an order and have order confirmations enabled.
If your trading service does not support OCO functionality, then you will see this stated on the order confirmation/ticket window Notice: Your service does not support OCO orders. OCO functionality is managed locally and can fail due to connectivity or other issues!.
You can also look at the service specific page linked from the Data and Trading Services page which states for each service whether the service provides Server Managed OCO (Order Cancels Order) in the What Is Included section on that page.
Management of Attached Orders when Trading Service Supports Server-side Bracket Orders
In the case of when the trading service you are using supports server-side Bracket orders, the information in the General Management of Attached Orders does not apply in any way.
If a Trading service supports server-side Bracket orders, it is necessary to enable server-side Bracket orders within Sierra Chart by enabling Global Settings >> General Trade Settings >> Use Server-Side OCO and Bracket Orders for it to be used.
When using server-side Bracket orders, both the Parent and Attached Orders are sent at the same time to the Trading service and after that Sierra Chart has no responsibility for the management of them.
Any action on those Attached Orders would only be in response to actions that you perform manually or through an automated trading system.
The sending of the orders to the exchange, the canceling of them, and Quantity adjustment of the orders is handled completely by the Trading service and not Sierra Chart. It is for this reason why it is not always advantageous to use server-side Bracket orders because the management of those orders is not always going to be correct or reliable based upon feedback from the field.
To know if the trading service you are using supports server-side Bracket orders, refer to the service specific page linked on the Data and Trading Services page which states for each service whether the service provides Server Managed Bracket Orders in the What Is Included section on that page.
Using Attached Orders and Attached Order Settings
The user interface in Sierra Chart for Attached Orders is designed to be very straightforward. The basic concept is that for each Target (Limit order) or Stop (Stop Order) that you want, this will be 1 Attached Order.
If you want to have 2 Targets and a single Stop for the entire position, then this will be 3 Attached Orders.
Refer to the images below for a visual presentation.
- Attached Orders are configured through the Trade Window for a chart or Trade DOM. Go to your chart or Trade DOM. Select Trade >> Open Trade Window for Chart.
- You will see the Targets tab on the Trade Window. Select this tab. This is the tab for Attached Orders. Although the tab is named Targets, it also applies to Stop Attached Orders as well.
- If you want to start completely fresh with your own Attached Order configuration, then press the Remove button until all of the Attached Orders in the list box above are removed. Initially, you will normally see 2 Attached Orders already added which make up a simple bracket. There is one Target order and Stop order. You can keep these Attached Orders and modify them as required and add additional ones.
- Press the Add button to add an Attached Order. The Attached Order will be added to the list box above.
- The controls on the Targets tab control the selected Attached Order in the Attached Order list. To modify an existing Attached Order, simply select it from the list box at the top and modify the settings for it by using the controls below the list box. We will explain this in more detail.
- The first step is to set proper Order Type. You can make it either a Target type or a Stop type.
For Stops you have many Stop Order Types to choose from including Trailing Stops.
To make the first Attached order a Target, then select Target: Limit in the Type list.
- Each Attached order has one or more Offset controls. The offsets can be specified as an actual Price value, a number of Ticks, or a Percentage of the last trade price. Select either Price, Ticks, or % (Percentage). The default setting is Ticks. For further details, refer to Offset Values.
- In the case of a Target, set the Limit Offset, to the amount from the parent order where you want the Target order to be.
For example, if you are setting it in Ticks, and the tick size for the symbol is .25 and you want the Target to be 2 points from your entry price, then set Limit Offset to 8.
In the case of a Stop, set the Stop Offset, to the amount from the parent order where you want the Stop to be.
- Set the OCO Group for the selected Attached Order. By default this should be set correctly. In the case where there are multiple Targets and a single Stop and you want the Stop to protect the entire position, then you will need to set the OCO Group for the Stop Attached Order, to All OCO Groups. In this case the Stop will act as a common Stop for all Targets.
- Set the Quantity for each Attached Order. By default, the quantity should be set correctly. If you are using a single Target and Stop, then this needs to be set to the quantity of the Parent/main order.
- If the Type is set to a Stop order type, and you want to move the Stop to break even based on various conditions, then you need to set the Move to Breakeven for Stop settings as required. Refer to Move to Breakeven for Stop for instructions.
- Repeat the steps 4-11 for each Attached Order you want to add.
- At the bottom of the Targets tab, set the Time in Force for the Attached Orders to either Day or Good Till Canceled.
- To have the Attached Orders you have defined, attached to a new order that you submit, select the Main or C tab and enable Use Attached Orders.
- At this point you are all set and you can now submit an order and the Attached Orders will be attached to it.
Attached Order Rules
When you are adding Attached Orders or modifying the controls for Attached Orders, there are certain rules that must be followed. The Attached Orders interface does not allow you to do something which does not follow the rules. If the rules are not followed, you will notice that changing a setting for an Attached Order will not work. The following are the rules:
Attached Orders are grouped into OCO Groups. In the list of Attached Orders you will notice a number after Target or Stop, this will be 1 through 5 or All. This indicates the OCO Group number. With this understanding, you can only have one Target and one Stop per OCO group, not more. Likewise, there can also be only a maximum of 2 orders per group. These two orders form an OCO pair. If a Target or a Stop is in the All Groups OCO Group, this counts as one order for all of the other groups 1-5. So if you have a Target 1 and a Stop All Attached Orders, then it will not be possible to add a Stop 1 because Stop All applies to OCO Group 1. There can only be one Attached Order set to All Groups.
For example, if you have 2 orders set to be a Stop and then you try to set the OCO Group for one of them to All Groups, this will not be allowed because each group cannot have more than one Stop order. In this case what you need to do is first set one of the Stops to be a Target instead and then you can change the other Stop to All Groups.
Attached Order Display List
This list box at the top of the Attached Orders (Targets) tab lists all of the attached or child orders that will be attached to a parent order.
Adds a new attached order. After you add this order, modify the settings using the various settings controls. You can have as little as one Attached Order, or many. Refer to the Order Types page for a list of all of the Attached Orders available.
Removes the Attached Order highlighted in the Attached Order list box.
Order Type (Type)
This is the order type of the Attached Order. See Order Types.
Each Attached Order is specified with one or more offsets. An offset is how far away from the parent order price that the Attached Order price is.
There are different 3 different units to specify an offset (Price, Ticks, Percentage). These offsets are relative to the price of the parent order. The parent order is the main order that you submit that the Attached Orders are attached to.
In the case where the parent order is a Market order, then these offsets are relative to the current market price (Last trade price).
When the parent order fills, these offsets are then always relative to the fill price since the Attached Orders will be adjusted upon a fill or partial fill of the parent order to maintain the specified offsets in the case when a server-side bracket order is not being used and Global Settings >> General Trade Settings >> Adjust Attached Orders to Maintain Same Offset on Parent Fill enabled.
The offsets always entered as positive numbers. The Attached Order feature will automatically convert the offset to the proper price value based upon whether the parent order is a Buy or Sell order and the Attached Order Type.
There are three different ways to specify an Offset value:
- Percentage (%) from the parent order price.
In the case of when using a Percentage (%) for the Attached Order Offset value, the formula is as follows: OffsetPrice = SpecifiedOffsetAsPercent * 0.01 * BasePrice.
BasePrice is the main/parent order price in the case of a non-Market order. In the case of when the main/parent order is a Market order, it is determined from the Quote Data for the symbol. You can see the Quote Data through the Window >> Current Quote Window. In the case of a Sell Market order the Bid price is used for the BasePrice. In the case of a Buy Market order the Ask price is used for the BasePrice.
If there is no Quote Data available and the values are zero, then BasePrice is the last trade price in the chart. The result is rounded to the nearest tick.
- Number of Ticks from the parent order price.
- A fixed Price from parent order price.
How Offsets are Converted
The Limit, Stop and Trigger offsets are converted to a price based on the following rules:
- When the Attached Order type is Limit or Market if Touched and the parent is a Buy: The Offset is added to the parent order price.
- When the Attached Order type is Limit or Market if Touched and the parent is a Sell: The Offset is subtracted from the parent order price.
- When the Attached Order type is Stop, Stop-Limit, or Trailing Stop and the parent is a Buy: The Offset is subtracted from the parent order price.
- When the Attached Order type is Stop, Stop-Limit, or Trailing Stop and the parent is a Sell: The Offset is added to the parent order price.
OCO Group (Groups)
Sierra Chart supports 8 different OCO (order canceled order) Groups and the All OCO Groups group.
An OCO (order cancels order) Group consists of 2 orders. This is a Target and a Stop.
When one fills or is canceled, the other will be canceled. If you have just a single target or a single stop and not a corresponding stop or target, then there is no OCO group.
Although the OCO Group setting needs to be specified for each Attached Order regardless.
This setting is for associating Targets and Stops into pairs. Each pair will have its own OCO group unless you are just using a single Target or a single Stop.
If you wish to use a common Stop for multiple Targets, then you would set the OCO Group for that Stop order to All OCO Groups and this will split the Stop into more than one order and place one order into each of the OCO Groups used by the other Attached Orders.
When an Attached Order in the All OCO Groups OCO group is split up, the quantity of each of these individual split orders is equal to the quantity of the group that it is placed into. Examples of how this works is explained in the OCO Group Examples section.
The advantage of not using a common Stop when there are multiple Target orders is that the Stop orders can be adjusted independently. Otherwise they cannot be.
If you are using more than one OCO Group, then the parent order quantity is split up into individual smaller orders that equal the number of OCO groups used (maximum of 5).
Therefore, if you are using 2 OCO groups, then the parent will be split into two independent orders, that are linked together. The sum of the order quantities for every OCO group must be less than or equal to the parent order quantity. The Target and Stop orders in each OCO group need to have an identical quantity, which happens automatically.
The reason that parent orders and Stop orders for each OCO Group are split into individual orders and are not combined together is for two very important reasons:
1. In the case where there is server-side OCO functionality, the orders in each OCO group must have identical quantities.
2. There is a more logical association between orders in an OCO Group when they are independent orders and the orders do not span more than 1 OCO group each.
This is the quantity of the Attached Order. All Attached Orders within the same OCO Group must have the same quantity, so this setting specifies the quantity for the entire group. The All Groups OCO Group quantity is automatically set and is equal to the parent order quantity.
Order Quantity Matching
It is necessary that the sum of the Quantity for each of the Target orders or the Stop orders, whichever is greater, must be equal to or less than the main order Quantity set on the Main/C tab. You can easily tell whether there is a match or not, by looking at the status text at the top of the Trade Window. Refer to the images below. Even if there is not a match, as long as the main order quantity is greater, then you can still submit an order.
Move to Breakeven for Stop
The Move to Breakeven for Stop section is to set move to breakeven functionality for the Stop Attached Order currently selected in the Attached Order list at the top of the Targets tab.
The Move to Breakeven for Stop settings apply various Move to Breakeven functionality for the selected Attached Stop order. This Move to Breakeven functionality works independently from any other functionality the selected Stop order supports like Trailing Stop functionality.
The Move to Breakeven for Stop settings support 2 separate Move to Breakeven actions. These are referred to as Step 1 and Step 2. First Step 1 is applied to the Stop and when that is complete, then Step 2 Move to Breakeven settings are applied.
- Add a Stop Attached Order if you have not already and select in the list of Attached Orders at the top of the Targets tab. You can use any Stop order type that you want. For example, you could apply Move to Breakeven functionality to a Triggered Trail Stop-Limit order type.
- Select Step 1 in the Move to Breakeven for Stop frame. Refer to the image.
- Set the Type setting in the Move to Breakeven for Stop frame to the type of move to breakeven action that you want. Refer to the Type description. For the most basic type of move to breakeven action, choose Offset in Ticks Triggered.
- Once you have selected the type that you want, then set the other controls in the Move to Breakeven for Stop frame as required. Review the descriptions below. For the Offset in Ticks Triggered type, you will need to set the Breakeven (BE) Level Offset and the Trigger Offset settings. The Trigger Offset needs to be a positive number.
- Once you have the Move to Breakeven settings as you require, then there is nothing further to do.
- If you want to set a second Move to Breakeven action once the first step has completed, then select Step 2 in the Move to Breakeven for Stop frame and follow the instructions above again starting at step 3.
Step 1 / Step 2
This setting controls what particular Step number, 1 or 2, the current Move to Breakeven controls apply to. Once the first Moved to Breakeven step completes, then Step 2 Moved to Breakeven settings apply, if the Type for Step 2 is set to a setting other than None.
The following are the possible types of move to breakeven actions that can be performed on a Stop order type. Choose the one that you require. Depending upon which one you have chosen determines what other settings are required.
- None: When this option is selected, there is no Move to Breakeven action that will be applied to the selected Stop order.
- Offset in Ticks Triggered: When this option is selected and the trigger price calculated from the Trigger Offset setting is reached, then the Stop order will be moved to the breakeven level.
- OCO Group Triggered: When this option is selected and the Target order in the specified OCO Group has partially or fully filled, then the Stop order will be moved to the breakeven level.
- Trail to Breakeven: When this option is selected, the Stop order will immediately begin to trail the market price when the parent order fills or partially fills, and stop at the breakeven level.
- Trail to Breakeven Offset Triggered: When this option is selected, and the trigger price calculated from the Trigger Offset setting is reached, then the Stop order will begin to trail the market price and stop at the breakeven level.
Breakeven (BE) Level Offset
The breakeven level is the parent order fill price. The parent order is the order that the Attached Orders are attached to. This parent order fill price is the breakeven/reference price when the Stop order is moved to the breakeven level. When using the Scaling-In functionality, this breakeven price is adjusted and uses the average of the original parent price and the fill prices of the orders used for scaling in. The Breakeven (BE) Level Offset specifies the number of Ticks from this breakeven price that the Stop order will be moved to. If you specify 1, the breakeven level price is 100 and the Tick Size is 1, then a Sell Stop will be moved to 101 when triggered. In the case of a Trail to Breakeven Stop, the trailing action will end when the Stop order gets to 101.
This level offset can be either a positive or negative number. With the preceding example, if you use a offset of -1, then the Stop order will be moved to 99.
This specifies the offset in Ticks that the current market price needs to move to from the parent order fill price, to trigger the move to breakeven action. For example if the parent order fills at 100, the Tick Size is 1, Trigger Offset is set to 5, then when the market reaches 105 a Sell Stop will be automatically moved to the breakeven level.
Trigger OCO Group
This setting only applies when you have set the Type to OCO Group Triggered. When the Target order in the selected OCO Group fills, then the stop order will be moved to the breakeven level. In order for this to work, there must be a Target order defined in the specified OCO Group.
Time In Force
It is necessary to set the Time in Force (TIF) for Attached Orders. The setting is at the bottom of the Targets tab of the Trade Window for the chart. Refer to the image below.
Use Attached Orders
The Use Attached Orders option is found on the Main tab of the Trade Window. When this is enabled, then when you enter an order from the Trade Window, from the chart, from the Chart DOM, from the Trade DOM, or from a Spreadsheet System for Trading auto-trade system, the Attached Orders defined on the Trade Window will be attached to the submitted order.
Each chart or Trade DOM has its own Trade Window. Make certain that you are enabling Use Attached Orders on the correct Trade Window. Go to the chart or Trade DOM and select Trade >> Open Trade Window for Chart to open or activate the correct Trade Window and then on the Main tab, enable Use Attached Orders. For further information about this, refer to Trade Window Settings not Applying to Chart or Trading DOM.
Attached Orders will not be attached to the order when using the Flatten command.
If an order is entered from an ACSIL (Advanced Custom Study Interface and Language) Auto Trade system, then that auto trade system controls whether or not Attached Orders will be used and the setting of this option is not relevant for those automated orders.
Attached Orders will not be attached to the order when reducing the size of your position and there is not a new resulting position, and Support Scale Out is enabled on the Trade Window menu accessed through the Menu/M button on the Trade Window.
If you disable Menu/M >> Support Scale Out on the Trade Window, Attached Orders will be attached to the order even if you are reducing the size of your position or scaling out.
If the Use Attached Orders option is not enabled, then in no case are the Attached Orders attached to any order.
Reversing Position and Attached Orders
If you are reversing your current Trade Position either by using the Reverse button on the Trade Window, which also cancels the current orders, or by using a Market order, Order Quantity and Side (Buy/Sell) which will reverse your Position, then the Attached Orders will be attached to the order which will establish a new Position in the opposite direction. The quantities of these Attached Orders will match the new resulting Position.
For example, if your current position is +5, you enter a Sell Market order with a quantity of 8, then a Sell order of 5 will be submitted without Attached Orders to flatten the existing Position and a Sell Market order of 3 will be submitted with Attached Orders. This only occurs if you are using a Market order.
In the case of a reversal, you need to consider the quantity of the order that establishes a new Position. If the quantity is 1 and your Attached Order configuration consists of 2 Targets, this is not going to work and you will receive an error message.
So you need to define another Attached Order configuration that consist of only a single Target and Stop and save it as a Trade Window Configuration.
You then need to switch to this before you do a reverse. Refer to Using a Preconfigured Attached Orders Set.
Using a Preconfigured Attached Orders Set
To save a Trade Window configuration which includes your currently defined Attached Orders, select M >> Save Configuration on the Main tab of the Trade Window for the chart. Enter or select a File Name and press Save.
To use a saved Trade Window configuration which includes the Attached Orders set, select the name from the drop-down list of saved Trade Window configurations on the Trade Window. Refer to the images below.
Trade Window configuration files are stored in the Sierra Chart Data Files Folder. They have the extension twconfig. You can easily share these files with other users. To find the location of this folder, select Global Settings >> General Settings. The Data Files Folder displays the path to the folder.
When Sierra Chart submits an order, it will first split up the order into the number of OCO Groups you are using. For example, if you are using 3 different OCO Groups, there will be 3 different parent orders (each with the quantity specified with the Group Quantity setting). For more information about OCO Groups, see the OCO Group section. Sierra Chart will manage all of the OCO Groups for you. So even though there are multiple parents due to splitting, you only need to modify or cancel one of them to modify or cancel all of the parents.
After an order is submitted with Attached Orders, the Attached Orders go into a held state until the parent order is filled.
When the parent order fills or partially fills, the Attached Orders are adjusted so that the Attached Order offsets from the parent order fill price are exactly the same as you have specified in the Attached Order settings, if Global Settings >> General Trade Settings >> Adjust Attached Orders to Maintain Same Offset on Parent Fill is enabled.
This adjustment does not occur in the case of Server-side managed Bracket orders.
Once the parent is filled or partially filled, the Attached Orders activate to the extent of the filled quantity of the parent. For example, if a parent order has a quantity of 5, and it partially fills to a quantity of 3 with 2 remaining, then the Attached Orders become active with a quantity of 3.
When an Attached Order completely fills, the other order (sibling order) in the same OCO Group is automatically canceled.
If an Attached Order partially fills, then the other order (sibling order) will have its quantity reduced by the amount of the fill.
If the parent order is canceled, assuming it can be canceled, the Attached Orders for it are canceled as well. If there are multiple parent orders that were split from an original parent order, then when one of those parent orders is canceled, the other parents are canceled along with the Attached Orders for it. If one of the Attached Orders is cancelled, the parent will not be cancelled, but the other order in the same OCO Group will be cancelled.
When the parent order is modified, Sierra Chart will also modify all of the other parent orders that were split from the original order as well.
When a parent order is modified, the Attached Orders for it are also modified to maintain the same offset they had to the parent order previously.
When an Attached Order is modified and it still has a Pending Child status, then the offset that it has to that parent order is updated to the new offset. This offset is used to adjust the Attached Order when the parent order fills so that the Attached Order maintains the identical offset it had to the parent order before the parent order filled.
Sending Attached Orders Independently
Normally, Attached Orders are submitted along with a new order that you enter from a chart, Trading DOM or the Trade Window. This occurs when Use Attached Orders is enabled on the Trade Window for the chart or Trading DOM. However, you may wish to send the Attached Orders independently without a parent order.
For instructions to Send Attached Orders independently, refer to Send Attached Orders by Position/Price in the Order Types documentation.
Changing Attached Orders Configuration After Parent Order Sent
Follow the instructions below to change the configuration of Attached Orders for a parent order after the parent order has been submitted.
- For the easy ability to switch among different Attached Order configurations, save each configuration as a Trade Window Configuration.
- Cancel the existing Target and Stop orders for the parent order. For instructions, refer to Modifying and Canceling Orders on the Chart on the Chart Trading page.
- Select the particular Attached Order configuration you want to use and then use the Send Attached Orders Order type.
Using Single Common Stop
To use a common Stop order when there are multiple Target Attached Orders, only add 1 Stop order and set the OCO Group for that Stop order to All OCO Groups.
When this is done, there will be multiple Stop orders created, one for each Target order. After modifying one of these stop orders on a chart or Trade DOM after the are submitted, the other Stop orders in the Attached Order set will be automatically adjusted at the same time.
Refer to the image below.
Attached Orders Examples
This section documents examples of Attached Orders that you can use.
Simple Bracket Example
- Set the Quantity on the Trade Window for the main order, which is known as the parent order, to the required order quantity. For information about submitting an order, refer to Entering an Order from the Trade Window.
- Set the Order Type for the main order.
- Add a Target Attached Order in OCO Group 1. The Type needs to be set to Target: Limit. The Attached Order Quantity will be automatically set.
- Add a Stop (Stop) Attached Order in OCO Group 1. The Type needs to be set to Stop: Stop. The Attached Order Quantity will be automatically set.
- When submitting the parent order, either a Buy or Sell, the above two Attached Orders will be submitted with it. In total there are 3 individual orders linked together in a parent-child relationship. The 2 Attached Orders (Target and Stop) are in a single OCO Group.
- Set the Quantity on the Trade Window for the main order, which is known as the parent order, to the required order quantity. In this case the order quantity must be at least 2. For information about submitting an order, refer to Entering an Order from the Trade Window.
- Set the Order Type for the main order.
- Add a Target Attached Order in OCO Group 1. The type needs to be Type: Limit. The Attached Order Quantity will be automatically set and can be manually modified to meet your requirements.
- Add a Target Attached Order in OCO Group 2. The type needs to be Type: Limit. The Attached Order Quantity will be automatically set and can be manually modified to meet your requirements.
- Add a Stop (Stop) Attached Order in All OCO Groups. The type needs to be Type: Stop. The Attached Order Quantity will be automatically set and cannot be changed since the OCO Group is set to All OCO Groups.
- Sierra Chart will send to your connected trading service or to the trade simulation system, 2 OCO group orders as follows:
- The first OCO group order will have a parent order with approximately 50% of the order quantity. Attached to that parent order will be 2 Attached Orders, a Limit and Stop. Each having the same order quantity as the parent order.
- The second OCO group order will have a parent order with the remaining order quantity. Attached to that parent order will be 2 Attached Orders, a Limit and Stop. Each having the same order quantity as the parent order.
Target with Move to Breakeven and Trail Stop Example
This example provides detailed step-by-step instructions for both Target and Stop Attached Orders. The Stop will move to the breakeven level after a certain profit amount has been reached on the Trade Position and then trail the market after another set profit amount has been reached.
- Open the Trade Window for the chart or Trade DOM by selecting Trade >> Open Trade Window for Chart on the menu.
- Select the Targets tab.
- In the list box at the top of the Targets tab that lists the Attached Orders, select the topmost order, if any and then press the Remove button as many times as is needed to remove all of the orders from the list.
- Press the Add button. The added order will be a Target.
- Set the Limit Offset to the number of ticks that you want to be filled that away from the entry order.
- Set the Quantity to match the main order quantity. This already should be set properly and will not need to be changed.
- Press to Add button again. The added order will be a Stop.
- Set the Type to Stop: Triggered Trail Stop.
- Set the Stop Offset to the number of ticks that you want the initial stop price to be at.
- Set the Trigger Offset to the number of ticks of profit that you want before the trailing stop action will begin.
- Set the Trail Offset to the number of ticks away that you want to trail the current market price by once the Stop is triggered.
- In the Move to Breakeven for Stops frame, set the Type to Offset in Ticks Triggered.
- In the BE Level Offset box enter 0 to move the stop exactly to breakeven or 1 to move the stop to breakeven +1.
- Set the Trigger Offset (Ticks) to the number of ticks that you want of profit before the stop is moved to the breakeven level.
The image below is an example of an Attached Order configuration where there are 2 Targets and 2 Stops. The first Stop is set to Move to Breakeven after a 4 Tick profit.
Trade Window Configuration File Examples
This section contains Trade Window Configuration files with Attached Order configurations requested by Sierra Chart users. To use these files, follow the instructions in Using a Trade Window Configuration File Provided to You.
It is recommended that you test these Trade Window configurations in Trade Simulation Mode before using them for live trading.
When Support Scale Out is enabled, there are Attached Orders (child orders) or orders that are in an OCO (order cancels order) group with an Open order Status, you then enter a new order of the same side (Buy/Sell) that is reducing the quantity of your position, and that order fills, then the Attached Orders or OCO orders for the same side will have their quantities reduced by the filled quantity of the new order you entered, or the Attached Orders or OCO orders will be canceled if they have the same or less quantity as the fill quantity of the new order you entered.
To enable Scale Out functionality, select Trade >> Open Trade Window for Chart. On the Main or C tabs press the Menu/M button and make sure there is a checkmark by Support Scale Out. Refer to the image below.
You can set whether you want the nearest orders or furthest orders adjusted using the Scale Out settings in Global Settings >> General Trade Settings.
When Support Scale Out is enabled, and you are reducing the size of your position and not reversing, then Attached Orders will not be attached to the new order even if Use Attached Orders is enabled.
When Support Scale Out is not enabled, then Attached Orders will be attached to the new order that you enter if Use Attached Orders is enabled.
When an Attached Order (child order) or an order in an OCO group is canceled due to a detected Scaling Out condition, then the following message will be added to the Trade >> Trade Service Log: Scale Out: Canceling Child or OCO order due to order fill of same side.
When Support Scale In is enabled, you have an existing Position and there are Attached Orders already Open, then when you increase the size of the Position with a new order, the existing Attached Orders will be increased in quantity to match when the order fills and the Position is increased. In this case, new Attached Orders are not submitted. To use the Scale In function, the following conditions need to be met:
- The Scale In functionality needs to be enabled by selecting Trade >> Open Trade Window for Chart. On the Main or C tabs press the Menu/M button and make sure there is a checkmark by Support Scale In.
- There are Attached Orders defined on the Trade Window for the chart.
- Use Attached Orders is enabled on the Trade Window for the chart.
- You are not using Flatten or Reverse.
- You are not using one of the OCO (Order Cancels Order) order types. Example: OCO Buy Stop Sell Stop.
- There are already Attached Orders working on your trade account for the symbol. Attached Orders that are in a Pending Child state are not considered.
- You have an existing Long position and you are increasing the Long position quantity.
- Or you have an existing Short position and you are increasing the short position quantity.
Hiding Attached Orders on Chart until Parent Fill
When a chart is in Chart Trade Mode, Attached Orders displayed on the chart can be hidden until the parent order fills.
To do this, go to the Trade Window for the chart. For instructions, refer to Opening Trade Window for Chart or Trade DOM.
Press the M/Menu button on the Trade Window. Enable the Hide Pending Attached Orders option on the menu and make sure there is a checkmark by it. When this is done, Attached Orders will not be displayed on the chart until the parent order fills and they become working.
Study Controlled Targets and Stops
Sierra Chart provides a study named Trade Management By Study. This study will modify the nearest working Target or Stop order for the symbol of the chart to match the most recent value of a selected Study Subgraph in a study. This Study Subgraph is used to set the order price of the Target or Stop. The nearest Target or Stop order is considered the one nearest to the current trade price.
The study monitors the chart for Open Attached Orders (Targets or Stops). These are Attached Orders that are currently Open due to a parent order that was previously filled. If no orders exist, the study will not do anything. Once an Open Target or Stop is found, then based on the most recent value of the selected Study Subgraph, the Trade Management By Study study will continuously modify the order price to match.
Full source code for the study can be found in \ACS_Source\AutomatedTradeManagementBySubgraph.cpp in the folder that Sierra Chart is installed to.
- Select Analysis >> Studies on the menu.
- Add the study named Trade Management By Study. For additional details to add a study to a chart, refer to Adding/Modifying studies.
- Press the Settings button.
- Select the Settings and Inputs tab.
- Set the Enabled input to Yes.
- Set the Order Type To Manage input to Stops or Targets depending upon whether you want to adjust a Stop or Target order.
- Set the Controlling Subgraph Reference input to the particular Study and Study Subgraph that will control the Target or Stop. The Study Subgraph is a particular line/plot within a Study. First select the Study and then the particular Study Subgraph within that study. The study must be on the same chart.
- Set the Trailing Offset (in Ticks) input, to the number of ticks away from the controlling Study Subgraph that the order should be when it is modified.
- Set the ACS Tool # Control Bar button for Enable/Disable input to the ACS Tool # Control Bar button number you can use to enable and disable the study. This is optional.
- Set the Position Type input to All Positions, Long or Short to indicate the type of positions you want to this study to be active on.
- Press OK. Press OK.
- Select Global Settings >> Customize Control Bars >> Control Bar 1-8 on the menu.
- Expand the Tools sublist. Scroll down until you see the list of ACS Tool # items. Select the number that you set the ACS Tool # Control Bar button for Enable/Disable input to. This step is optional. Press OK.
- If the Control Bar is not visible, select Window >> Control Bars >> Control Bar 1-8. There will be a button on the Control Bar named TMS which can be used to easily enable and disable this study.
- When this study is enabled, and there is an open Target or Stop order, it will be modified to track the controlling Study Subgraph.
- If a Target or Stop order is not modified, then set the Detailed Logging (for debugging) input to Yes. This will cause messages added to the Window >> Message Log indicating the reason for the problem. Refer to the Study Input Settings section for further details.
Study Input Settings
- Enabled: Enables or disables this study. When this is set to No, then the automatic modification of the found Stop or Target order will not be performed.
- Order Types To Manage: Select to either manage Stops or Targets. If you need to manage both at once, add the study twice.
- Controlling Subgraph Reference: A reference to the Study and the Subgraph of that study which controls the order price.
- Order Adjustment Timing: Determines when or how often to modify the Target or Stop order. Supports two methods On Bar Close and Every N Seconds.
On Bar Close: Will use the referenced study Subgraph value at the previous bar in the chart.
Every N Seconds: Will use the referenced study Subgraph value of the most recent bar in the chart at the frequency specified by Adjustment Frequency (in Seconds).
- Adjustment Frequency (in Seconds): The minimum interval in seconds between order modifications. Only relevant if Every N Seconds is selected for the Order Adjustment Timing input.
- Trailing Offset (in Ticks): The offset in Ticks (Chart >> Chart Settings >> Tick Size) which the order trails the controlling Study Subgraph by.
A positive or negative value can be used for Trailing Offset.
For a long position, the order being controlled would be a Sell order. In this case, the Trailing Offset value is subtracted from the Study Subgraph value. As an example, if the Study Subgraph is a Moving Average, a positive value for the offset would trail the order N ticks below the Moving Average. A negative value would trail the order N ticks above the Moving Average.
For a short position, the order being controlled would be a Buy order. In this case, the Trailing Offset value is added to the Study Subgraph value. As an example, if the Study Subgraph is a Moving Average, a positive value for the offset would trail the order N ticks above the Moving Average. A negative value would trail the order N ticks below the Moving Average.
- ACS Control Bar Button # for Enable/Disable: This is the ACS Control Bar button number to be associated with this study to enable and disable the order modifications. To add this button to the Control Bar, refer to Customize Control Bars.
- Position Type: This can be set to All Positions, Long or Short to indicate the type of Positions you want this study to be active on.
- Detailed Logging (for debugging): When this input is set to Yes, then any time an order adjustment does not occur, a message indicating the reason is added to the Window >> Message Log. This is useful to determine the reason for the problem. A message is only added once per reason. So if the same reason occurs again, a new message will not be added.
Potential Conditions Which Can Lead to Attached Orders Not Functioning As Expected in Live Trading
This section documents specific cases where Attached Orders may not always function as expected. Do know that these are uncommon conditions. In simulated trading, these conditions cannot occur.
Market Moving Quickly Beyond Stop Price Causing It to Become Invalid
Example Scenario: You have an attached sell Stop order that has been submitted with your main parent buy order. The parent order that the attached Stop order is attached to, fills and then the market moves quickly against your resulting position. When the Stop order is transmitted on a fill of this parent, the market price has already moved below the sell Stop order price. If you are using a trading service which rejects sell Stop orders with a price which is above the current market price, then the Stop order is going to be rejected. Likewise in the case of a buy Stop order. This type of scenario only happens when you use a tight Stop, the market is moving quickly against your entry order, and you are using a trading service that rejects Stop orders that would immediately fill based upon the current market price.
Automatic Replacement Market Order for Rejected Stop Attached Order
When Global Settings >> General Trade Settings >> Auto-Send Market Order On Rejected Stop Attached Order is enabled and a Stop Attached Order is Rejected after being sent and originally had an Order Sent status, it will be resent as a Market order to offset the new position established by its parent order.
There are many safeguards in place to ensure that this market order is only sent when there is a rejected Stop Attached Order and when there is an actual established Trade Position from the original parent order.
When this market order fills, any Target order that also exists will be canceled. This feature does not work with Interactive Brokers due to the proven uncertainty of order statuses with that service.
Failure to Increase Quantity Due to Simultaneous Fill of Target/Stop Order Being Adjusted
Example Scenario: There are Attached Orders attached to a parent order. The parent order has a quantity of 10 for example.
The parents fills in 2 lots of quantities of 5 each. The Attached Orders are transmitted with an initial quantity of 5 each to match the first fill of 5.
These Attached Orders, then need to be modified to a quantity of 10 each due to the second parent fill of 5. Each of these order modifications are pending until the initial order transmission that they are trying to modify has been acknowledged and the initial Attached Order goes into an Open state.
When an Attached Order goes into a Open state and there is a pending modification, that modification is then performed. So therefore the quantity of each Attached Order is increased to 10 individually at the time when the Attached Order has become Open.
However, say the market price moves and then fills one of those Attached Orders that we are modifying and it fills before the modification is actually performed and that modification is rejected.
For example, the Target order got filled before it could be increased to 10, then you no longer have a Target order in place since the modification to increase it to 10 failed.
This is a very rare scenario, and only has a probability of occurring, although low, if you are using tight targets and stops.
User Switching to Trade Simulation Mode before Attached Orders Sent
In the case of non-simulated trading, if Attached Orders are managed on the client-side and the Trading server does not provide server-side OCO or bracket order support, then until the parent order fills, the Attached Orders are held on the client-side within Sierra Chart.
For more information, refer to General Management of Attached Orders.
Therefore, before the Attached Orders have been sent to the connected Trading server, if you were to enable Trade >> Trade Simulation Mode On before the parent order has filled, and the parent order fills while Trade Simulation Mode is enabled, the Attached Orders will not be sent to the connected Trading server because Trade Simulation Mode prevents any non-simulated trading.
Using Attached Orders with Attached Orders
It is not supported to use Attached Orders which are attached to another Target or Stop Attached Order.
Instead what you need to do is submit a new independent order at the same price and side as the existing Target or Stop order and that new order needs to have its own Attached Orders.
Unable to Modify Price of Attached Orders
When modifying the Price or Quantity of an Attached Order before the Parent order has filled and it does not change, then the usual case for this problem is that server-side Bracket orders are being used and the Trading service Sierra Chart is connected to, is not allowing the modification.
The solution to this is to uncheck Global Settings >> General Trade Settings >> Use Server-Side OCO and Bracket Orders.
After unchecking this option, it is necessary to cancel the Parent order and Attached Orders and submit them again. You will then be able to modify the Attached Orders.
Using DTC Server Feature for Reliable Server-Side Attached Orders
Follow the instructions below to use the DTC Server feature in Sierra Chart for reliable server-side Attached Orders.
- Set up a computer server in a reliable data center or location with reliable Internet connectivity. This can be a dedicated server or virtual server through a server hosting service.
- Install a copy of Sierra Chart on that server.
- Configure Sierra Chart to use the particular Trading service that you want. Refer to Data and Trading Services for the instructions for each of the supported services.
- Disable Global Settings >> General Trade Settings >> Use Server-Side OCO and Bracket Orders in the copy of Sierra Chart running on the server. You instead will want to rely upon the Sierra Chart managed functionality for this. This is overall going to be better if you have a highly reliable server with a reliable Internet connection.
- Install another copy of Sierra Chart on the computer you will be working from and connect to the instance of Sierra Chart running on the server using the DTC Protocol Server feature.
- In the copy of Sierra Chart running on the computer you are working from, you will want to enable Global Settings >> General Trade Settings >> Use Server-Side OCO and Bracket Orders to use this functionality provided by the copy of Sierra Chart running on the server.
*Last modified Tuesday, 20th December, 2016.