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

Re: EZ question about EZ Language.... :-)



PureBytes Links

Trading Reference Links

> Sorry to disturb You but I assume You know the EZ language at
> least 1.000.000 X better then I do and You might help me to create
> some entry sentence in EZ language. Here is the sutuation : 

I didn't notice Tom had CC'd the list.  For anyone who's interested, 
here's my reply to him.  Hopefully I got it right.  :-)

==============

To:             TomKochik@xxxxxxx
Subject:        Re: EZ question about EZ Language.... :-)
Send reply to:  fritz@xxxxxxxx
Date sent:      Tue, 18 Aug 1998 20:34:46 -0600

Hi Thomas,

Funny how "Easy" language isn't always so "Easy," isn't it?  :-)

> I simply don't know how to make TS to refer to the LOW [0] and if
> the LOW [0] is considered to be the Bar that gave the signal or the
> Bar where I Bought ? 

OK, a couple of things:

1. You've got the right idea with the Exitlong.  When you say 
"Exitlong at Low-10 points", you are specifying the Low of the bar 
you're currently in.  If you're in the signal bar, then Low is the 
low of the signal bar.  "Exitlong at Low[1]-10 points" sets the exit 
point at 10 pts below the *previous* bar's low.

2. On the Exitlong you also need to specify "Stop" or "Limit".  
"Stop" says to exit a long at that price *OR LOWER*, and "Limit" says 
to exit at that price *OR HIGHER*.  (And vice versa for shorts -- see 
pp. 98 & 107 in the Easy Language manual.)  So you should use Limit 
for your profit target, and Stop for your stoploss.  I suspect this 
is why it's exiting your trades in the entry bar -- because you gave 
it a stoploss price below the bar, and said it was a "Limit" order, 
so any price above that price (including the close of the bar!) 
triggers it.

3. When you set a stop or limit order in Tradestation, it is in 
effect for THE NEXT BAR **ONLY**.  So if your target or stoploss 
price is hit in the VERY NEXT BAR, you're golden.  If it isn't, 
Tradestation very conveniently "forgets" it.  You have to re-issue 
the order in EVERY BAR until the price is hit.  It's a pain, but 
that's how it works.  So you have to store the target price in a 
variable and re-issue the order every bar until you hit the price.

So:

> EXITLONG ("TRG2") from Entry ("P/EBU") AT$ Close+300 Points Limit;  
>   { Above is my Goal }
> EXITLONG ("TRG3") from Entry ("P/EBU") at (Low[1]-10 points) Limit;
>   { And here is my desired STOP }

I think what you want is something like:

Vars: LTarget(0), LStop(0);

{ On the signal bar: }
if (your_condition_is_met) then begin
  LTarget = Close + 300 points;
  LStop = Low - 10 points;
  end;

{ Then, on every bar: }
if (H > LTarget) or (L < LStop) then begin
  LTarget = 0;        { Price hit, so cancel the stops }
  LStop = 0;
  end;

if (LTarget <> 0) then
  EXITLONG ("TRG2") from Entry ("P/EBU") at Target Limit ;  
if (LStop <> 0) then
  EXITLONG ("TRG3") from Entry ("P/EBU") at LStop Limit ;

...and the opposite for your shorts.

That should get you close to it, anyway!

Good luck,
Gary