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

RE: [amibroker] Re: Moving Average Channels



PureBytes Links

Trading Reference Links

Title: Message
The statement that creates LowerBand is inside a loop. This usually causes this error. Add this before the loop to any assignments generating an error:
 
LowerBand = 0;
 
Error reporting inside loops is way better than it used to be, but the compiler still gets confused sometimes by pointing to the wrong problem. When I find the "right" error, things clear up and work as they should.
 
--
Terry
-----Original Message-----
From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of m.smith
Sent: Monday, May 30, 2005 6:52 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] Re: Moving Average Channels

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



 
Add FUN to your email - CLICK HERE!

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





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