BracketOrderTicket Class (Component)
The Bracket OrderTicket component generates and sends bracket order
tickets for a specified symbol from your EasyLanguage code. BracketOrderTicket
objects support a number of the same order parameters (see below) that
are available when placing a bracket order from the TradeStation Order
Bar (OCO/OSO button). The status of all BracketOrderTicket orders
appear on the Orders tab of the TradeManager along with other regular
orders.
Typically, you will use the Toolbox
to add a component to your EasyLanguage document. Click and drag
the name BracketOrderTicket into
your document from the Toolbox. By default, the name of the provider
appears in the component tray at the bottom of your document followed
by a number (to help identify multiple instances of the component).
Open the Properties
editor and locate the properties under "General". Specify
a symbol and account in the Symbols
and Accounts fields as well as
the order Action (Buy, Sell, etc.).
Verify that the Quantity
and other properties are as you intend before leaving the Properties editor.
You'll need to specify the Target
Type and Protection Type
and the typePrice or typePriceStyle
and typePriceOffset for the stop
and limit prices.
You can also set property values for a specific bracket order object
in EasyLanguage code, by assigning a value to BracketOrderTicket1 followed
by a 'dot operator' and an BracketOrderTicket property name (including
inherited properties).
BracketOrderTicket1.Quantity=200;
//
changes the order Quantity to 200 shares.
After a bracket order ticket is prepared in your EasyLanguage code,
place the order using the Send()
method (inherited from the OrderTicketBase
class). To track the status of the order it's recommended that you save
the sent order instance to an Order object variable. Be aware that
an order will be generated each time the Send method is executed for an
bracket order ticket object, so you'll need to take care that your EasyLanguage
code controls when each order ticket Send occurs (such as using Once as in the following example).
var:
order MyOrder(null); // an order object variable
will be used to save the sent order instance.
Once
MyOrder = BracketOrderTicket1.Send(); //
send an order generated with the BracketOrderTicket1 object and assign order
to MyOrder.
It is strongly recommended that you fully test BracketOrderTicket
with your Simulated Accounts before using real
Accounts. After inserting an indicator containing an order object
to an analysis window, you'll need to go to the Format-General tab
and check Enable
order placements objects to
allow orders to be sent from the indicator.
Namespace: tsdata.trading
Additional
properties, methods, and events are described in the classes listed
under Inheritance Hierarchy (see below).
|
Name |
Type |
Description |
|
Account |
string |
Sets
or gets the ID of the account used for order placement. |
|
Action |
enum |
Sets
or get the order action. See OrderAction
for a list of possible values. |
|
Duration |
string |
Sets
or gets the order duration. (eg. "DAY", "DAY+",
"GTC", "GTC+", "GTD", "GTD+","FOK",
"IOC","OPG", "1 Min", "3
Min", "5 Min" ) |
|
Duration
Date |
datetime |
Sets
or gets a duration date for GTD. |
|
LimitPrice |
double |
Sets
or gets the limit price for the order. |
|
LimitPriceOffset |
int |
Sets
or gets the limit price offset value. |
|
LimitPriceStyle |
enum |
Sets
or gets the limit price style. See PriceStyle
for a list of possible values. |
|
Protection |
object |
Gets
the OSOOrderTicket object representing the protect order in the bracket. |
|
ProtectionLimitPrice |
double |
Sets or gets the value of the protection limit price. |
|
ProtectionLimitPriceOffset |
int |
Sets or gets the offset increment associated with
the protection limit price. |
|
ProtectionLimitPriceStyle |
enum |
Sets or gets the price style setting for protection
limit orders. See PriceStyle
for a list of possible values. |
|
ProtectionStopPrice |
double |
Sets or gets the value of the protection stop price. |
|
ProtectionStopPriceOffset |
int |
Sets or gets the limit offset increment associated
with the protection stop price. |
|
ProtectionStopPriceStyle |
enum |
Sets or gets the price style setting for protection
stop orders. See PriceStyle
for a list of possible values. |
|
ProtectionType |
enum |
Set
or gets the protection order type. Refer to OrderType for a list. |
|
Quantity |
int |
Sets
or gets the quantity of shares or contracts for the order. |
|
Route |
string |
Sets
or gets the route for the order. |
|
StopPrice |
double |
Sets
or gets the stop price for a stop order. |
|
StopPriceOffset |
int |
Sets
or gets the stop price offset value if using an 'auto'
stop price style. |
|
StopPriceStyle |
enum |
Sets
or gets the stop price style. See PriceStyle
for a list of possible values. |
|
Symbol |
string |
Sets
or gets the symbol to trade. |
|
SymbolType |
enum |
Sets
or gets the security type of the symbol. See SecurityType
for a list of possible values. |
|
Target |
object |
Gets the OSOOrderTicket object whose primary ticket is a Limit order to exit the position;.. |
|
TargetLimitPrice |
double |
Sets or gets the value of the target limit price. |
|
TargetLimitPriceOffset |
int |
Sets or gets the offset increment associated with
the target limit price orders. |
|
TargetLimitPriceStyle |
enum |
Sets or gets the limit price style setting for target
limit orders. See PriceStyle
for a list of possible values. |
|
TargetType |
enum |
Sets
or gets the target order type. See OrderType
for a list of possible values. |
|
Name |
Description |
|
Clone |
A cloned instance of the class. |
|
Create |
Initializes
a new instance of the class. |