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

[amibroker] Re: help needed with zigzag->Nomore zigzag needed



PureBytes Links

Trading Reference Links

--- In amibroker@xxxxxxxxxxxxxxx, "murthysuresh" <money@xxx> wrote:
>
> i am trying to plot the peaks and troughs.
> i could use some help with the zigzag as i am confused with the paramter % change which is defined as a number. any ideas is appreciated.
>

ok. i had so much trouble  with itthat i started coding without zigzag.
here is my starter code. any ideas and help appreciated.

i just plotted the peaks and troughs.


_SECTION_BEGIN("CCI_Divergence");
//WARNING: CODE LOOKS 1 DAY INTO FUTURE.
array=CCI();
Color=colorBlue;
//Plot( array, "", colorDefault, styleLine | styleThick | styleNoLabel); 
//Plot( array, "", Color, styleHistogram ); 
_SECTION_END();

Change=MA(abs(100*(array-Ref(array,-1))/array),14);

adjz = Param("Zig",10,0,15.0,.1);
adjc = Param("Back",0,0,BarCount,1);
CAdj = Ref(array,-adjc);
Graph1 = CAdj;
Zigzag = Zig( array, LastValue(Change));
Plot( Zigzag, "Zigzag", colorGreen, styleNoTitle | styleLine ); 
//Peakshape=IIf(Peak(array, LastValue(Change),1),shapeStar,shapeNone);
//Peakvalue=Peak(array, LastValue(Change),1);

//PlotShapes(Peakshape,colorRed);
firstVisibleBar=Status("firstvisiblebar");
	lastVisibleBar=Status("lastvisiblebar");

CCITurningdown=array>Ref(array,-1) AND array >Ref(array,1);
CCITurningup=array<Ref(array,-1) AND array<Ref(array,1);

CCIpeak= IIf(array>0 AND CCITurningdown,shapeStar,shapeNone);
CCItrough= IIf(array<0 AND CCITurningup,shapeSquare,shapeNone);
PlotShapes(CCIpeak,colorRed);
PlotShapes(CCItrough,colorRed);


Look4Shorts=EMA(C,9)<EMA(C,20);
Look4Longs=EMA(C,9)>EMA(C,20);

PlotShapes(IIf(ValueWhen(CCItrough,C,1)>C AND ValueWhen(CCItrough,CCItrough,1)<array,shapeCircle,shapeNone),colorOrange);
/*

CCI Divergence Occurs when the c < valuewhen(ccirough) and cci >last ccitrough.

*/


 for ( b = firstVisibleBar;((b < lastVisibleBar) AND (b<BarCount)) ;b++ )
{
//_TRACE("valie of peak" + NumToStr(Peakvalue[b]));


}







------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

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

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

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