PureBytes Links
Trading Reference Links
|
a quick help
STUT = H > Ref(H, -1) AND
Ref(H, -1) > Ref(H, -2);
STDT = L < Ref(L, -1) AND
Ref(L, -1) < Ref(L, -2);
Hi=HighestSince(STUT, H);
Ppeak[0]=High[0];
for(i=2;i<BarCount;i++)
{
if(STDT = 1)
PPeak[i] = Hi[i];
else
PPeak = PPeak[i-1];
}
Plot(Ppeak,"",2,1);
Plot(C,"",1,64);
pennellp2000 wrote:
>
>
> I am trying to change the following Metastock Close Above Prev Peak
> formula to Amibroker
>
> STUT := H > Ref(H, -1) AND
> Ref(H, -1) > Ref(H, -2);
>
> STDT := L < Ref(L, -1) AND
> Ref(L, -1) < Ref(L, -2);
>
> PPeak := If(STDT = 1,
> HighestSince(1, STUT, H), PREV);
>
> PPeak;
>
> CAPP := If( C > PPeak, 1, 0);
>
> I have got part of it as below but need help with some of it. I have
> had a look at Cross( Close,Peak(High,3,1)) but I want to define the
> peak as the highest point between a short term uptrend and a short
> term down trend. A short term uptrend occurs if the price breaks the
> previous days high on 2 consecutive days (ie 2 consec' days of higher
> highs). A short term downtrend is where the price breaks the previous
> days low on 2 consecutive days (ie 2 consec days of lower lows).
> Once the 2 consec HH or LL occur the price and the trend continues
> to rise or fall until a change of trend occurs.
> Thanks in advance Phill.
>
>
>
> STUT= High > Ref(High,-1) AND Ref(High,-1) > Ref(High,-2);
> STDT = Low < Ref(Low,-1) AND Ref(Low,-1) < Ref(Low,2);
> Ppeak =IIf(STDT = 1,HighestSince(STUT,High,1),Ref(STDT,-1));
> Cross(Close,Ref(Ppeak,-1));
>
>
>
>
>
>
> Check AmiBroker web page at:
> http://www.amibroker.com/
>
> Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html
>
>
> *Yahoo! Groups Sponsor*
> ADVERTISEMENT
> click here
> <http://us.ard.yahoo.com/SIG=129511rd2/M=295196.4901138.6071305.3001176/D=groups/S=1705632198:HM/EXP=1097455594/A=2128215/R=0/SIG=10se96mf6/*http://companion.yahoo.com>
>
>
>
> ------------------------------------------------------------------------
> *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
> <mailto:amibroker-unsubscribe@xxxxxxxxxxxxxxx?subject=Unsubscribe>
>
> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service <http://docs.yahoo.com/info/terms/>.
>
>
>
>
> __________ NOD32 1.881 (20040930) Information __________
>
> This message was checked by NOD32 antivirus system.
> http://www.nod32.com
[Non-text portions of this message have been removed]
------------------------ Yahoo! Groups Sponsor --------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/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/
|