Sell (Reserved Word)

image\trumpet2.gif Disclaimer

The Sell order is used to close a long position. The order specifications are defined by parameters in the Sell statement.

Exit orders do not pyramid. Once the exit criteria are met and the exit order filled, the order is ignored for that position until the position is modified (that is, more shares/ contracts are bought or a new long position is established).

Sell [("Order Name")] [from entry ("Entry Name")] [ Number of Shares [Total]] [Execution Method];

Only the word Sell and the Order Action are required by the order syntax rules. For example:

Sell this bar on close;

or

Buy next bar at 45 stop;

If no other parameters are specified, the default value for the Order Name is "Sell", and all long contracts will be exited from the position.

Each portion of the statement, Order Name, Number of Shares, from entry and Execution Method are described next.

Order Name

When using multiple exits within a strategy, it is helpful to label each exit order with a different name. This enables you to identify these exit orders in both the price chart and the Strategy Performance Report. To assign an exit order a name, specify a name in quotation marks and within parentheses immediately after the word Sell. For Example:

Sell ("My Exit") This Bar on Close;

This instruction closes the entire long position, and the order is labeled My Exit.

Tying an Exit to an Entry

It is possible to tie an exit instruction to a specific entry. This can be achieved only if you named the long entry, and the long entry is in the same strategy as the exit order. Consider the following strategy:

Buy ("MyBuy") 10 Shares Next Bar at Market;
Buy
20 Shares Next Bar at High + 1 Point Stop ;

Sell From Entry ("MyBuy") Next Bar at High + 3 Points Stop;

In the above example, the strategy may buy 30 shares total; your long position is 30 shares. However, the Sell instruction only closes out the 10 shares bought using the MyBuy entry order. It ignores any other order, and does not close out the other 20 shares. Therefore, this strategy leaves you long 20 shares.

You can also close part of an entry order. For example, if your entry, which you named "MyBuy" buys 10 shares, you can specify that you want to exit from entry "MyBuy" but only close out 5 shares, not the entire 10:

Sell From Entry ("MyBuy") 5 Shares Next Bar at High + 3 Points Stop;

  Important The entry name is case sensitive. Be sure to use consistent capitalization. Also, it is important to remember that exit orders do not pyramid; therefore, if an exit does not close out an entire position, you will need another exit order (or reversal order) in order to close out the position.

Number of Shares/Contracts

To specify how many shares/contracts to close out, use a numeric expression followed by the word shares or contracts after the trading verb Sell. Some Examples:

Sell 100 Shares This Bar on Close;

Sell From Entry ("MovAvg") 10 Shares Next Bar at High + 1 Point Stop ;

  The words shares and contracts are synonymous.

If you do not specify the number of shares or contracts in the Sell instruction, the exit order closes out the entire long position, rendering your position flat.

When you specify the number of shares/contracts, the Sell instruction exits the specified number of shares/contracts from every open entry.

Therefore, if the Strategy allows for pyramiding, and has bought 500 shares twice (for a total of 1,000 shares), and an order to Sell 100 Shares is placed by the Strategy, the instruction will exit a total of 200 shares: 100 shares from each of the two entries.

However, if you want to exit a total of 100 shares, you can use the word Total in the Sell instruction. Using the word Total instructs the Strategy to exit 100 shares from the first open entry (first in, first out). For Examples:

Sell 100 Shares Total This Bar on Close;

Sell From Entry ("MovAvg") 10 Shares Total Next Bar at High + 1 Point Stop ;

Order Action

You must specify one of the five different order actions with your Sell order.

... this bar on close;

... next bar at open;

... next bar at market;

... next bar at yourprice Stop;

... next bar at yourprice Limit;

The execution method this bar on close is provided for backtesting purposes only; it enables you to back test ’market at close’ orders, which you cannot automate using TradeStation. Given that all orders are evaluated and executed at the end of each bar, TradeStation reads and issues the this bar on close order once the bar has closed (for example, once the daily trading session has ended). TradeStation fills the order using the close of the current bar, but you have to place an order at market to be executed on the next bar. This invariably introduces slippage.

The execution method Sell next bar at price Limit instructs TradeStation to exit a long position at the first opportunity at the specified price or higher. The execution method Sell next bar at price Stop instructs TradeStation to exit a long position at the first opportunity at the specified price or lower.

By default, a strategy stop or limit order will be considered filled at the stop or limit price if that price falls within the range of the bar on which the order is active.  When automating a strategy, the user has the option of selecting whether to mark strategy orders as filled based on 'price activity' or when the TradeManager reports that the order was actually filled in the market.

Tying the Exit Price to the Bar of Entry

When specifying the execution method, you can vary stop and limit orders by using ’At$’ instead of ’at’. Using At$ forces the strategy to refer to the value the numerical expression price had on the bar where the entry order was generated. Consider the following statement:

Sell From Entry ("MyBuy") Next Bar At$ Low - 1 Point Stop;

The above statement places an order to exit the long position at one point lower than the low of the bar where the order to establish the long position was generated (for example, if an order to Buy next bar... is generated today, the prices referenced will be today’s, not tomorrow’s. Even though the order was placed and filled tomorrow, it was generated today, and that is the bar referenced).

To use the At$ reserved word, you must name the entry order, and the Sell instruction must refer to the specific entry order.

As another example, if the maximum risk you will tolerate for a position is 5 points under the closing price of the bar on which you generated the entry order, you can use the following statement:

Sell From Entry ("MyBuy") Next Bar At$ Close - 5 Points Stop;

This is a valuable technique that allows you to refer easily to the prices of the bar on which the entry order was generated.

Example

This statement exits all contracts/shares of your open long position at the close of the current bar. Your position will be flat.

Sell This Bar on Close;

Additional Examples

The next instruction exits all contracts/shares of your positions opened by the entry order Entry#1 at the open of the next bar, and the exit order is named LongExit.

Sell ("LongExit") From Entry ("Entry#1") Next Bar at Market;

The following statement places an order to close 5 contracts/shares in total at the low of the current bar minus 1 point or anything lower. This order is active throughout the next bar (until filled or canceled):

Sell 5 Contracts Total Next Bar at Low - 1 Point Stop;

The next instruction places an order to exit 100 shares from every entry at the high plus the range of the current bar or anything higher. This order is active throughout the next bar (until filled or canceled) and will be named HighExit.

Sell ("HighExit") 100 Shares Next Bar at High + Range Limit;

The following statement allows you to monitor your risk by placing an exit order 5 points below the closing price of the bar that generated the long entry order:

Sell From Entry ("MyBuy") Next Bar At$ Close - 5 Points Stop;