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

Re: [amibroker] Troughs and peaks higher



PureBytes Links

Trading Reference Links

> Can anybody help me enter code to find stocks that
> have peaks and
> troughs higher than the previous peaks and troughs.

John

I have had a look at the Trough and Peak functions.

You might try something along these lines and modify
to suit.

**********
code
**********
// --- trough search --- //

Z = 1;
P0 = Peak(H,Z,0);
P1 = Peak(H,Z,1);
P2 = Peak(H,Z,2);
P3 = Peak(H,Z,3);

T0 = Trough(L,Z,0);
T1 = Trough(L,Z,1);
T2 = Trough(L,Z,2);
T3 = Trough(L,Z,3);

Filter = P0 > P1 AND
P1 > P2 AND
P2 > P3 AND
T0 > T1 AND
T1 > T2 AND
T2 > T3;

AddColumn(P0,"p0",1.2);

Plot(C,"CLOSE",1,64);
Plot(Zig(H,Z),"zigHigh",colorRed,1);
Plot(Zig(L,Z),"zigLow",colorGreen,1);

*****
end
*****

regards

ChrisB
=================================================






		
__________________________________ 
Do you Yahoo!? 
The all-new My Yahoo! - Get yours free! 
http://my.yahoo.com 
 



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

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.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/