PureBytes Links
Trading Reference Links
|
Instead of assigning a variable percentage to identify peaks, wouldnt
it be easier to say a high greater than the two preceeding and two
following highs as determining a peak?
--- In amibroker@xxxxxxxxxxxxxxx, "Dimitris Tsokakis" <TSOKAKIS@xxxx>
wrote:
> is an interesting AFL question. Since Peak() built-in function does
not accept variable percentage,
> we can take the analytic road and see the fixed and variable
percentage effect.
> An example curve MA(RSIA(MACD(),5),25), [the black bold line], a
fixed initial percentage 20%,
> the respective peak recognition yellow line, a variable percentage
from 20% to 60% and the respective
> red line and the result : The variable percentage line skips minor
peaks P11, P111 and goes from P1
> directly to P2. The explanation : P1 is ~68, P11 is ~54, less then
P1-20%P1 and it is a peak for the
> fixed percentage. But, near P11, the variable percentage is ~45 and
P11 should be less than 40 to
> be recognised as a peak again.
> Play with the IB code
>
> F=MA(RSIA(MACD(),5),25);Plot(F,"",1,8);// EXAMPLE CURVE
>
> R=20;// THE FIXED PERCENTAGE
> COEFP=1-R/100;
> COND1=Ref(Ref(F,-1)==HHV(F,3),1);
> PeakVALUE=ValueWhen(COND1,F);
> COND11=PeakVALUE<COEFP*Ref(PeakVALUE,-1) OR PeakVALUE>Ref(PeakVALUE,-1);
> PeakVALUE1=ValueWhen(COND11,F);
> Plot(PeakVALUE1,"",7,8);// FIXED % PEAK LINE
>
> R=R+Cum(1)%40;Plot(R,"",9,1);// THE VARIABLE PERCENTAGE
> COEFP=1-R/100;
> COND1=Ref(Ref(F,-1)==HHV(F,3),1);
> PeakVALUE=ValueWhen(COND1,F);
> COND11=PeakVALUE<COEFP*Ref(PeakVALUE,-1) OR PeakVALUE>Ref(PeakVALUE,-1);
> PeakVALUE1=ValueWhen(COND11,F);
> Plot(1.02*PeakVALUE1,"",4,8);// VARIABLE % PEAK LINE
>
> Dimitris Tsokakis
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get Home Early - Access Your work PC
http://us.click.yahoo.com/usvdqB/Yq8FAA/uetFAA/GHeqlB/TM
---------------------------------------------------------------------~->
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
|