[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ExitLong and ExitShort in TS2000



PureBytes Links

Trading Reference Links

At 10:16 PM 11/23/2002, John Lynch wrote:
>According to the help files I should be able to use the command:
>   "  ExitLong 5 contracts this bar on close;  "
>
>to exit 5 long positions.  When I use it (exact format) I find that it exits
>all my long positions.  I can label each position seperately and exit using
>the command:
>"  ExitLong from entry ("MyTrade") this bar on close;  "
>
>but it creates very poor code with 20 positions and 3 possible long entries.
>
>Does anyone know what I might be doing wrong?  How can I just exit the last
>X bars entered without naming each position?
>
>John

 From the Omega EasyLanguage file online for TS 6 (and the same for TS2000i, but use ExitLong instead of Sell)

"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)."

So try:
ExitLong 5 contracts Total this bar on close;

This should help you, John, but only if you want to close out trades in the first-in first-out order. If you want to get fancier, you'll have to refer to the entries by name.

HTH,

Mike Gossland