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

[amibroker] Re: Moving Average Channels



PureBytes Links

Trading Reference Links

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 );







------------------------ Yahoo! Groups Sponsor --------------------~--> 
Has someone you know been affected by illness or disease?
Network for Good is THE place to support health awareness efforts!
http://us.click.yahoo.com/Rcy2bD/UOnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/