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

Exiting multiple positions from multiple entries - Revisited



PureBytes Links

Trading Reference Links

I'm using TS2000 and was wondering about exiting 
positions generated by different orders.  I want to be 
able to take advantage of the Strategy testing 
Resolution for tick bars.  I'm using intraday data on 1 
minute charts and want the ticks to count when I have 
them to use. This is only for historical, not live.  
I'm allowing pyramiding.

For example, with the stock price at 55.00 I put in the 
following:
Buy("Order1") at 56.25 stop;
Buy("Order2") at 56.50 stop;

So, let's say that now the stock is on it's way up to 
58.00.
I want to set a trailing stop on the position entered 
with "Order1" and I want that trailing stop to be .35.
Then, I want to give the position entered with "Order2" 
more room to breathe by setting a trailing stop at for 
it at .50 cents.

But, if I use:
SetDollarTrailing(.25);
SetDollarTrailing(.50);

Then I'll be stopped out on everything at 25 cents.

I could track the progress of the price at every bar,  
calculate a trailing stop price, save it in a variable 
called TrailingStopPrice1 and enter it like this:
ExitLong("Order1") at TrailingStopPrice1;

And do the same for Order2 with it's own stop:
ExitLong("Order2") at TrailingStopPrice2;

Now, this will work, but because it's not continually 
adjusted on every tick (remember, I'm using minute 
data, with historical tick level analysis), I'll miss 
out if the price rockets up on a bar by a buck, and 
then drops right back down to where it was. Won't I?

For example, using the prices from above, let's say the 
stock price is now 57.  The results of my calculations 
for trailing stop prices as yield this:
TrailingStopPrice1 = 56.75  (my .25 trailing stop)
TrailingStopPrice2 = 56.50  (my .50 trailing stop)

So, I enter my orders:
ExitLong("Order1") at TrailingStopPrice1;
ExitLong("Order2") at TrailingStopPrice2;

Now, on the next bar, this happens:
O=57, H=58, L=57, C=57
And on the following bar, this happens:
O=57, H=57, L=56, C=56

So, I didn't get stopped out, but I left money on the 
table because I couldn't re-adjust the stops as the 
price climbed.  I left .75 on the table for Order1 and 
.5 on the table for order 2.

It seems that the only thing that will allow me to get 
a true trailing stop that will handle conditions 
intrabar is the SetDollarTrailing.

The only thing I've been able to do is to calculate a 
trailing stop based on the H of the next bar, knowing 
it will go there.  While this accomplishes the 
objective, it is very messy and I'm not sure that when 
I do that, every tick is checked by TS when determining 
if the stop has been hit.

Any suggestions on another way I can approach this?

Thx,

Cash


"It's a dog eat dog world out there and I'm wearing milkbone underwear"