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

Re: [amibroker] Re: Moving Average Channels



PureBytes Links

Trading Reference Links

Elder describes one use in Come Into My Trading Room.  He feels parallel bands are better for trading than something
like Bollinger Bands that react to volatility.  The bands themselves generally represent exit points.  He recommends using
trend indicators in longer time frame and shorter term oscillators in combination to generate signals and trying to
buy/short near the EMA and sell/cover near the appropriate band.  He rates trades on how much of the channel was
'taken out' in profit.  30% or more would be a very good trade.
 
Elder doesn't advocate mechanical systems or tracking large numbers of stocks.  He recommends following a fairly
small number of stocks and getting to know how they behave and using a lot of discretion along with the technical
analysis.  His ideas probably wouldn't backtest very well in Amibroker, but it is an interesting book and has some
good ideas on money management and the need for and use of stops.
 
Bob
 
----- Original Message -----
Sent: Tuesday, May 31, 2005 5:31 PM
Subject: Re: [amibroker] Re: Moving Average Channels

Hi Marshall,
 
No, I dont have any special expertise with them - there was a recent question asking if it was possible to draw the bands so that 85% of the bars would be automatically included - I just thought it might be interesting to try and write the code.
 
Steve
----- Original Message -----
From: m.smith
Sent: Tuesday, May 31, 2005 5:37 PM
Subject: Re: [amibroker] Re: Moving Average Channels

Steve, A rhetorical question, but; Have you worked with  the bands long enough to have some comments on how they should be worked and evaluated for best performance.  I have been trying it as an indicator with subtle results, even a little confusion.  Marshall 
 
-------Original Message-------
 
Date: 05/31/05 15:18:38
Subject: Re: [amibroker] Re: Moving Average Channels
 
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@xxxxxxxxx>
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



 
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





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