PureBytes Links
Trading Reference Links
|
Philip,
Here's one approach to coding this trailing stop. I've written it this way
since I prefer not to use the PREV function because it greatly slows down
the computations. The disadvantage of this approach is that if a new LONG
signal is triggered while you are still in a LONG trade, the new Highest
High Value is in reference to that most recent LONG signal, not the one you
entered your trade on.
{Chandelier Exit}
RefHigh:=HighestSince(1,Long=1,H);
RefLow:=LowestSince(1,Short=1,L);
Fact=2.5;
ATRng:=Mov(ATR(1),10,S);
CloseLong:=CLOSE<(RefHigh-(FactHigh*ATRng));
CloseShort:=CLOSE>(RefLow+(FactLow*ATRng));
Dave Nadeau
Fort Collins, CO
> -----Original Message-----
> From: owner-metastock@xxxxxxxxxxxxx
> [mailto:owner-metastock@xxxxxxxxxxxxx]On Behalf Of Philip
> Sent: Tuesday, June 26, 2001 9:38 PM
> To: metastock@xxxxxxxxxxxxx
> Subject: Trailing stop formula
>
>
> Greetings,
>
> I would like to ask your help in writing a formula for trailing stops. The
> concepts themselves are very basic:
>
> For short trades: H + ATR(10)
> For long trades: L- ATR(10) . . . or some such, doesn't really
> matter at this
> point.
>
> But I'd like to write the formula in such a way that once a trade has been
> entered, the stop ONLY moves in the direction of the trade, or
> stays at the
> same level. Thus, in a short trade, the stop would only follow the market
> down or stay unchanged, it would never retrace any progress it's
> made, never
> give up any ground, even if the market moved up against the position. The
> same would hold true for a long trade, in reverse naturally. The trailing
> stop moves up with price, but goes sideways if the market drops, thereby
> letting the stop take me out.
>
> Has anyone been over this terrain? I am running MS 6.52.
>
> Best regards,
> Philip
>
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
|