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

Re: [amibroker] Re: Moving Average Channels



PureBytes Links

Trading Reference Links

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


------------------------ Yahoo! Groups Sponsor --------------------~--> 
What would our lives be like without music, dance, and theater?
Donate or volunteer in the arts today at Network for Good!
http://us.click.yahoo.com/Tcy2bD/SOnJAA/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/
 

Attachment: Description: Binary data