PureBytes Links
Trading Reference Links
|
Hi Philip,
Probably the easiest way to turn this flag on and off is to use the
BarsSince function. Create a variable that is defined by the low
volatility
Signal:=Sigma<Ref(Sigma,-Lookback);
EnterLong:= <the entry conditions here>;
EnterShort:= <the entry conditions here>;
ExitLong:= <the exit conditions here>;
ExitShort:= <the exit conditions here>;
Since you don't want to reenter a position until your low volatility
trade signal has occured, just make sure that the BarsSince your
Signal are less than the BarsSince your ExitLong or ExitShort.
This code will miss the first trade on the chart because BarsSince is
defined only after ExitLong or Exitshort exists. Roy had posted a
great workaround for this problem. I don't code very much in
Metastock anymore, so I haven't used his technique. Perhaps someone
can fill in that missing piece.
================
Dave Nadeau
Fort Collins, CO
> -----Original Message-----
> From: owner-metastock@xxxxxxxxxxxxx
> [mailto:owner-metastock@xxxxxxxxxxxxx]On Behalf Of Philip
> Sent: Friday, September 07, 2001 11:52 PM
> To: metastock@xxxxxxxxxxxxx
> Subject: Re: Dallas System by Keith Fitschen CODING ATTEMPT
>
>
> Greetings,
>
> Here's a first shot at coding the long side of "Dallas" --
> thanks to the generous assistance of Dave
> Nadeau! You'll see that I've used Dave's narrative as a
> kind of fill-in-the-blanks exercise. I'm not
> sure, though, how to include the set-up, i.e. the initial
> volatility contraction. Any suggestions?
>
> Looks like there might be some useful ideas in "Dallas." I
> would really appreciate any pointers the
> more experienced technicians in the house may have to offer.
>
> CMA:= Close-Mov(Close,LengthMA,S);
> Sigma:= StdDev(CMA,LengthStDev);
> LengthStDev:= 50;
> Lookback:= -22;
> LengthMA:=3;
>
> {When Sigma becomes less than the Sigma of 22 bars ago, the
> setup begins}
>
> Ref(Sigma > Ref(Sigma,Lookback),-1)?
> or how about
> Alert(Sigma > Ref(Sigma,Lookback), x?)
>
> and
> Sigma > Mov(Sigma, LengthMA ,S)
> and
> Sigma > Ref(Sigma, Lookback )
> and
> Close > Ref(Close, Lookback )
> {All signs that the volatility is increasing, and the price
> is beginning to move upward}
> and Close < Ref(Close,-1){small pullback}
> {then}
> {you'd enter long at the open of the next bar}
>
> Best regards,
> Philip
>
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
|