Steve I still get the error #29 low band is not initialized.
But all looks good to me cannot find error. Help, please.
Marshall
-------Original
Message-------
Date: 05/30/05
18:09:49
Subject: Re:
[amibroker] Re: Moving Average Channels
Hi Jack,
I was kind of intesrested in
seeing it too, so I played with it a bit this afternoon - here
is a better version and....it works
now! 8 - ) Sorry - I should learn
not to post code without trying it
first...
Steve
----- Original Message -----
From: "ckinsey2003" <ckinsey2003@xxxxxxxxx> To:
<amibroker@xxxxxxxxxxxxxxx> Sent: Monday, May 30, 2005
1:11 PM Subject: [amibroker] Re: Moving Average
Channels
>I like what you are doing with your MAs
but I get a syntax errof on > your FOR statment that is
beyond me. If you get it fixed pleas mail it > or post
it. > > Jack Kinsey > > Hi
again, > > As I read my own e-mail, I see that the
code could be better. Here is an > improved version with a
few changes: > > Steve >
------------------------------------------- > MovAvgPds =
13; > LookbackPds = 63; > Step = 0.25 // increment
bands by this much each step > WantInChan = 85 // want 85%
of bars to be inside channel > > MovAvg = MA( Close,
MovAvgPds ); > KeepLooping = True; > For( Incr = Step;
Incr < 100 AND KeepLooping; Incr = Incr + 0.25 ) >
{ > UpperBand = MovAvg + Incr; > LowerBand = MovAvg -
Incr; > InChan = High < UpperBand AND Low >
LowerBand > TotalInChan = Sum (InChan, LookbackPds
); > PctInChan = TotalInChan / LookbackPds * 100; >
If( PctInChan >= WantInChan ) > KeepLooping =
False; > } > > Plot( Close, "Close", colorBlack,
styleCandle ); > Plot( UpperBand, "Upper Band", colorBlue,
styleLine ); > Plot( LowerBand, "Lower Band", colorBlue,
styleLine
); > > > > > > > > >
Please note that this group is for discussion between users
only. > > To get support from AmiBroker please send an
e-mail directly to > SUPPORT {at}
amibroker.com > > For other support material please
check also: > http://www.amibroker.com/support.html > > >
Yahoo! Groups
Links > > > > > > > >
Please note that this group is for discussion
between users only.
To get support from AmiBroker please
send an e-mail directly to SUPPORT {at}
amibroker.com
For other support material please check
also: http://www.amibroker.com/support.html
|