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

Re: Faster Chandelier Exit



PureBytes Links

Trading Reference Links

I am not a MetaStock user so I can't comment too specifically on what might
help but I have these observations.

1.  You should determine which functions are taking the processing time and
slowing down the calculation.  There are 2 in the flawed function that was
originally posted: ATR(n) and HighestSince().  Both have to look back and
may contribute equally.

2.  ATR(n) could be sped up by computing "ATR" using an exponential moving
average instead of a simple moving average.  Each new bar provides a new
True Range to be averaged in and EMA's are trivial to code.  An EMA ATR will
of course not be the same as SMA ATR, but if I remember correctly, the
original Chandelier Exit used a multiple (2-5) of ATR(50).  An EMA value of
40 or so would probably be a good approximation.

Kent


-----Original Message-----
From: David Bozkurtian 
To: metastock@xxxxxxxxxxxxx 
Date: Friday, February 18, 2000 2:01 PM
Subject: RE: Faster Chandelier Exit


Ton,

Thanks for the heads up. I will continue to work on this because, as I
understand it, exits are extremely important. In the future, I will test
more thoroghly.

David


From: "Jeff Ledermann" 
Reply-To: metastock@xxxxxxxxxxxxx
To: 
Subject: RE: Faster Chandelier Exit
Date: Fri, 18 Feb 2000 23:07:41 +1000

Ton,

Tut, tut....  you of all people should have picked up what's
wrong here.

PREV probably *should* work like this but it doesn't

PREV gives you the previous value of the current expression
NOT THE PREVIOUS VALUE OF THE INDICATOR.

A simple test will prove that to anyone who doubts this.

Try:
vPrev:=PREV;
If(Cum(1) < 50,Cum(1),vPrev);

Versus:
If(Cum(1) < 50,Cum(1),PREV);

Cheers
Jeff.

>
> If the List had a Mail of the Year competition, I'd vote for your mail.
> Formula wise you are definitely getting the hang of it.
>

snip

> >
> > Anyway, here is how the code (at least this iteration) should be
modified to
> > speed up the calculation by a factor of 5. Basically, we move PREV into
a
> > variable vPREV prior to using it (so that it is only calculate once) in
the
> > long and short exits. Here is the code for the long exit. I tested it
with
> > the sample Entry Rule and receive the same results in 1/5th the time.
Just
> > modify the SHORT exit in the same way. Hope this helps everyone using
it.
> >
> > {DEFINE ENTRY PRICE, WITH EXIT BEING -- ENTRY PRICE AND NO TRADE BEING
0}
> > {Move PREV into a variable to speed things up - DB 2/17/00}
> > vPREV:=PREV;
> > EntryPrice:= If(vPREV <= 0,
> > {Trade entered today?}
> > If(LongEntry, CLOSE, 0),
> > {Trade entered before today. Stopped today?}
> > If(LOW <= vPREV - MoneyMgmtStop, -vPREV,
> > If(LOW <= HighestSince(1,vPREV=0, HIGH) - 3 * ATR(10), -vPREV,
> > If(LOW <= HighestSince(1,vPREV=0, CLOSE) - 2.5 * ATR(10), -vPREV,
> > vPREV))));
> >
> >
> > David


______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com