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

Re: [amibroker] Thanks Re: Moving Average Channels



PureBytes Links

Trading Reference Links

Hi JK,

Just FYI, Yahoo used to retain attachments so that anyone visiting the 
boards could see them. Then a while back, they announced that they would no 
longer retain attachments, I guess in an effort to free up resources. But if 
you opt to receive these posts as e-mails, they will forward the attachments 
along with the message. I like receiving the e-mails better than going to 
the boards anyway, but some people prefer not to receive 50-100 e-mails a 
day.

I am still trying to remember to include code inline rather than attaching 
it, but sometimes I forget   8 - (

Steve

----- Original Message ----- 
From: "ckinsey2003" <ckinsey2003@xxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Wednesday, June 01, 2005 10:19 AM
Subject: [amibroker] Thanks Re: Moving Average Channels


>I didn't know that Attachments didn't show. Learn something all the
> time. Thanks for resending it. I am trying to learn the FOR loop stuff
> and this will help. Thanks,   jk
>
> --- In amibroker@xxxxxxxxxxxxxxx, "Steve Dugas" <sjdugas@xxxx> wrote:
>> I sent it as an attachment. If you dont receive these posts as
> e-mails, I
>> guess you wouldn't see it. I have included it below.
>>
>>
>>
>> Steve
>>
>> ----------------------------------------------------------------
>>
>> // user defined params
>>
>> Field = Avg;
>>
>> MovAvgPds = 13;
>>
>> LookbackPds = 63;
>>
>> StepPct = 0.25; // increment bands by this percent each step
>>
>> WantInChan = 85; // want 85% of bars to be inside channel
>>
>> // error handling for stocks with very few bars
>>
>> MovAvgPds = Min( MovAvgPds, BarCount - 3 );
>>
>> LookbackPds = Min( LookbackPds, BarCount );
>>
>> // optimization loop
>>
>> StepAmt = LastValue( Field ) * StepPct / 100; // calculate % for
> each stock
>>
>> MovAvg = MA( Field, MovAvgPds );
>>
>> UpperBand = LowerBand = MovAvg;
>>
>> KeepLooping = True;
>>
>> for( Incr = StepAmt; Incr < LastValue( Field ) AND KeepLooping; Incr
> = Incr
>> + StepAmt )
>>
>> {
>>
>> UpperBand = MovAvg + Incr;
>>
>> LowerBand = MovAvg - Incr;
>>
>> InChan = High < UpperBand AND Low > LowerBand;
>>
>> TotalInChan = Sum (InChan, LookbackPds );
>>
>> PctInChan = LastValue( TotalInChan / Min( LookbackPds, BarsSince(
> IsEmpty(
>> MovAvg ) ) ) * 100 ); // more error handling
>>
>> if( PctInChan >= WantInChan )
>>
>> {
>>
>> KeepLooping = False;
>>
>> ChanPts = UpperBand - MovAvg;
>>
>> ChanPct = ChanPts / MovAvg * 100;
>>
>> }
>>
>> }
>>
>> // plot indicator
>>
>> Plot( Close, "Close", colorBlack, styleCandle );
>>
>> Plot( MovAvg, "MA", colorWhite, styleLine|styleNoTitle );
>>
>> Plot( MovAvgPds, "MA Pd", colorDarkRed,
>> styleOwnScale|styleNoLine|styleNoLabel );
>>
>> Plot( LookbackPds, "LB Pd", colorDarkRed,
>> styleOwnScale|styleNoLine|styleNoLabel );
>>
>> Plot( TotalInChan, "Inside Bars", colorDarkRed,
>> styleOwnScale|styleNoLine|styleNoLabel );
>>
>> Plot( PctInChan, "% Inside Bars", colorDarkRed,
>> styleOwnScale|styleNoLine|styleNoLabel );
>>
>> Plot( UpperBand, "Upper Band", colorBlue, styleLine|styleNoTitle );
>>
>> Plot( LowerBand, "Lower Band", colorBlue, styleLine|styleNoTitle );
>>
>> Plot( ChanPts, "Chan $", colorBlue,
>> styleOwnScale|styleNoLine|styleNoLabel );
>>
>> Plot( ChanPct, "Chan %", colorBlue,
>> styleOwnScale|styleNoLine|styleNoLabel );
>>
>> ----- Original Message ----- 
>> From: "ckinsey2003" <ckinsey2003@xxxx>
>> To: <amibroker@xxxxxxxxxxxxxxx>
>> Sent: Tuesday, May 31, 2005 9:27 AM
>> Subject: Re: [amibroker] Re: Moving Average Channels
>>
>>
>> > Steve, Thanks for fixing it but I don't see the new code ?? <G>
>> >
>> > Ever hopefull,    Jack
>> >
>> >
>> >
>> >
>> >
>> > 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
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
> 




------------------------ Yahoo! Groups Sponsor --------------------~--> 
In low income neighborhoods, 84% do not own computers.
At Network for Good, help bridge the Digital Divide!
http://us.click.yahoo.com/EpW3eD/3MnJAA/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/