EasyLanguage Object Reference
The OrderTicket component generates and sends an order ticket for a specified symbol from your EasyLanguage code. OrderTicket objects support a number of the order parameters (see below) that are available when manually placing an order from the TradeStation Order Bar. The status of all OrderTicket 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 OrderTicket into your document from the Toolbox. The name of the provider appears in the component tray at the bottom of your document. By default, the name is followed by a number to identify multiple instances of the component.
Open the Properties editor and locate the properties under "General". You'll need to 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. For example, Stop and Limit orders require that a typePrice or typePriceStyle and typePriceOffset be specified.
You can also set property values for a specific order object in EasyLanguage code, by assigning a value to OrderTicket1 followed by a 'dot operator' and an OrderTicket property name (including inherited properties).
OrderTicket1.Quantity=200; // changes the order Quantity to 200 shares.
After the order ticket is prepared in your EasyLanguage code, you 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 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 = OrderTicket1.Send(); // send an order generated with the OrderTicket1 object and assign order to MyOrder.
It is strongly recommended that you fully test OrderTicket
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