PureBytes Links
Trading Reference Links
|
Larry,
You had mentioned you wanted a indicator
that was more responsive. I use the Awesome Oscillator by Gary Thompson, but
have modified it to use Weighted Moving Average and different Period
parameters. The result is EXTREMELY responsive. Try it out, and Good Trading.
Don Lindberg
_SECTION_BEGIN("Awesome
WMA Oscillator with Change");
/* Awesome Oscillator code for Amibroker
Written
By Gary Thompson
07th
April 2005 . Modified by Don Lindberg 03-28-2007 */
SetChartOptions(0,chartShowDates|chartShowArrows
|chartWrapTitle);
T=Param( "Time Period for MA",24,0,1000,1);
KMA=((C-WMA(C,T))/WMA(C,T))*100;
S=Param( "Time Period for SlowMA",15,0,1000,1);
SlowMA=WMA( Close ,S);
F=Param( "Time Period for FastMA",5,0,1000,1);
FastMA=WMA( Close,F);
barcolor= IIf((SlowMA
- FastMA) <= Ref(SlowMA - FastMA, -1),colorGreen,colorRed);
Buy= (SlowMA - FastMA) <= Ref(SlowMA - FastMA, -1);
Sell= (SlowMA - FastMA) >= Ref(SlowMA - FastMA, -1);
Filter=C>=1 AND
C<=50 AND C>WMA(C,T)
AND (SlowMA - FastMA) <= Ref(SlowMA -
FastMA, -1)AND V>=100000 ;
Buy = ExRem( Buy, Sell );
Sell = ExRem( Sell, Buy );
PlotShapes( IIf( Buy, shapeDownArrow
+ shapePositionAbove, shapeNone ), colorGreen );
PlotShapes( IIf( Sell, shapeHollowUpArrow
+ shapePositionAbove, shapeNone ), colorRed );
Graph0=FastMA-SlowMA;
Graph0Style=2+5;
Graph0BarColor=barcolor;
AddColumn(Close,"Close",1.2);
AddColumn((WMA(C,T)),"WMA",1.2);
//AddColumn ((SlowMA - FastMA) <= Ref(SlowMA - FastMA,
-1),"Buy ");
AddColumn (V,"Volume", 1.0);
Score=Filter=C>=1 AND C<=50 AND C>WMA(C,T)
AND (SlowMA - FastMA) <= Ref(SlowMA -
FastMA, -1) AND V>=100000;
SetSortColumns(-6);
Title="Awesome
Zero Lag Oscillator w/ Buy Sell arrows for "+Name()+"
"+Date()+" The Close is "+WriteVal(abs(KMA),format=1.2)+"%"+WriteIf(KMA>0," above"," below")+" the "+T+" period WMA";
_SECTION_END();
From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Larry
Sent: Wednesday, April 18, 2007
3:32 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: RE: [amibroker] Blau: TSI
& Ergodic Oscillator
Hi Don,
Wow! Exactly what I was looking for. Many thanks.
I hope to learn to do these codes myself eventually.
Regards,
Larry
On 18 Apr 2007 at 2:13, Don Lindberg wrote:
>
> Larry,
> If I understand what you want, then the code below will satisfy your Buy
and Sell statements, as
> well as plot buy and sell arrows.
> Buy = Cross(Ergodic,SigLin);
> Sell = Cross(SigLin,Ergodic);
> PlotShapes( IIf( Buy, shapeDownArrow + shapePositionAbove, shapeNone ),
colorGreen );
> PlotShapes( IIf( Sell, shapeHollowUpArrow + shapePositionAbove, shapeNone
), colorRed );
>
> You can then add whatever Filter and AddColumn statements you want for the
Exploration.
> (Example:)
> Filter=C>1 AND C<50 ;
> AddColumn(C," Close ",1.2);
> AddColumn(Ergodic," Ergodic ",1.2);
> AddColumn(SigLin," SigLin ",1.2);
>
> Hope this helps,
> Don Lindberg
>
>
>
> From: amibroker@xxxxxxxxxps.com
[mailto:amibroker@xxxxxxxxxps.com]
On Behalf Of Larry
> Sent: Tuesday, April 17, 2007 10:32 PM
> To: amibroker@xxxxxxxxxps.com
> Subject: Re: [amibroker] Blau: TSI & Ergodic Oscillator
>
>
> Hi Rick,
>
> Thank you so much for you response. I saw the following comment in the
forum too:
>
> "Green Histogram & Blue line above 0 is buy
> Red Histogram & Blue line under 0 is sell"
>
> However,the poster appeared to be seeking a confirmation whether his/her
assumption was
> correct. Unfortunately there was no response to the enquiry.
>
> From my observation, based on a comparison of the Ergodic chat with the
price chart of a stock,
> the stock's price will start moving up when the blue signal line crosses
above the Ergodic
> oscillator. And the price moves downward when the blue signal line crosses
below the Ergodic
> Oscillator.
>
> Could you please devise a code for the crossing without regard to whether
it is in the green or red
> histogram?
>
> Once again, thank you.
>
> Larry
>
> P.S. I'll also experiment with the code that you've already given me
below.
>
> On 18 Apr 2007 at 1:12, Rick Osborn wrote:
>
> >
> >If, as the forum says...
> >Green Histogram & Blue line above 0 is buy
> >Red Histogram & Blue line under 0 is sell
> >
> >Then the code would be
> >
> >Buy = Ergodic > SigLin AND Hist >= 0;
> >Sell = SigLin > Ergodic AND Hist < 0;
> >Filter = Buy OR Sell;
> >AddColumn(Filter,"Signal",1.0);
> >
> > (you may want to separate the Addcolumn stuff)
> >Rick
> >--- Larry <rayman@xxxxxxxxxxxorg>
wrote:
> >
> >> Hi there,
> >>
> >> I came across the above indicator at
> >> www.amibrokerfan.com (forum).
> >>
> >> I found it useful as an indicator but I was
> >> wondering if it can be turned into a scanner also
> >> with the inclusion of buy and sell signals. I am not
> >> sure but I think a buy signal is when
> >> the signal line crosses above the Ergodic
> >> Oscillator. Could someone please help with the
> >> necessary codes.
> >>
> >> I reproduce the original code below for your easy
> >> reference.
> >>
> >> Thank you.
> >> Larry
> >>
> >> // Blau: TSI & Ergodic Oscillator
> >>
> >> Len_r = Param( "TSI period 'r':", 32 , 1 , 100 );
> >> Len_s = Param( "TSI period 's':", 5 , 1 , 100 );
> >> Len_5 = 5 ;
> >>
> >> Mtm = C - Ref ( C, -1 );
> >> AbsMtm = abs ( Mtm );
> >> //===============================
> >> Num_T = EMA ( EMA ( Mtm, Len_r ), Len_s );
> >> Den_T = EMA ( EMA ( AbsMtm, Len_r ), Len_s );
> >>
> >> TSI = 100 * Nz ( Num_T / Den_T );
> >> //===============================
> >> Num_E = EMA ( EMA ( Mtm, Len_r ), Len_5 );
> >> Den_E = EMA ( EMA ( AbsMtm, Len_r ), Len_5 );
> >>
> >> Ergodic = 100 * Nz ( Num_E / Den_E );
> >> SigLin = EMA ( Ergodic, Len_5 );
> >> //===============================
> >> GraphXSpace = 2 ;
> >> //Plot( TSI, "TSI", colorGreen, styleLine );
> >> ErgCol = colorBlue ;
> >> Plot( Ergodic, "Ergodic Osc.", ErgCol, styleLine
> >> );
> >> Plot( SigLin, "", colorDarkYellow, styleLine );
> >> //===============================
> >> Hist = Ergodic - SigLin;
> >> HistCol = IIf ( Hist>= 0, colorGreen, colorRed );
> >> Plot(Hist, "Histogram", HistCol, styleHistogram |
> >> styleThick |
> >> styleNoLabel );
> >> //===============================
> >> Title = EncodeColor( colorDarkBlue ) + FullName() +
> >> " [" + Name() + "]
> >> " +
> >> EncodeColor( colorDarkGrey ) + WriteVal( DateTime(),
> >> formatDateTime ) +
> >> "\n" +
> >> EncodeColor( colorBrown ) + "Blau: The Ergodic
> >> Oscillator, EO(" +
> >> EncodeColor( ErgCol ) + "r" + EncodeColor(
> >> colorBrown ) + ",5,5 ) " +
> >> EncodeColor( ErgCol ) + "r_Pds: " + Len_r +
> >> EncodeColor( colorGrey40 ) + " (Adjustable).";
> >> //===============================
> >>
> >>
> >
> >Rick Osborn & Associates
> > 885 Sorrento
Ave.
> > Oshawa, Ontario L1J 6V6
> >(905) 728-8543 fax 728-0815
> >
> >
>
>
>
>
>
>
>
__._,_.___
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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
For other support material please check also:
http://www.amibroker.com/support.html
SPONSORED LINKS
__,_._,___
|
|