logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
matt1974  
#1 Posted : Tuesday, July 26, 2011 2:54:35 PM(UTC)
matt1974

Rank: Newbie

Groups: Registered, Registered Users
Joined: 9/24/2010(UTC)
Posts: 7

can anyone help me with formula to find the value of the previous monthly and yearly high and low. not sure if hhv and llv will be relevant but i need a formula to look for the month/year, not a bar count.
jjstein  
#2 Posted : Tuesday, July 26, 2011 4:30:44 PM(UTC)
jjstein

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/13/2005(UTC)
Posts: 715
Location: Midwest, USA

Was thanked: 1 time(s) in 1 post(s)
Try this:

_Plot HL
Plot:=Input("Plot 1=Month 2=Year",1,2,1);
PeriodsM:=21;
MonthlyH:=Ref(HHV(H,PeriodsM),-1);
MonthlyL:=Ref(LLV(L,PeriodsM),-1);

PeriodsY:=252;
YearlyH:=Ref(HHV(H,PeriodsY),-1);
YearlyL:=Ref(LLV(L,PeriodsY),-1);

If(Plot=1,MonthlyH,YearlyH);
If(Plot=1,MonthlyL,YearlyL);
mstt  
#3 Posted : Wednesday, July 27, 2011 4:31:50 PM(UTC)
mstt

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/25/2005(UTC)
Posts: 1,042

Was thanked: 57 time(s) in 54 post(s)
Hi Matt For a slighly different approach you could try this indicator. It's based on my EOD series of Multi-Frame formulas and plots selectable end-of-period prices for weekly through to yearly periods. You'll need the Forum DLL - this 188KB file is available as a download from the Files tab and must be installed as Forum.DLL and MetaStock restarted before the formula will work. A range of user options are available and the best way to figure out what they do is experiment. Hopefully the indicator posts without being corrupted - we shall see. {Period HHV/LLV} {Requires Equis Forum DLL} {Roy Larsen, 2011, 27/7/11} {Settings} N:=Input("Period HHV/LLV, 0=H 1=L 2=C 3=H&L ",0,3,2); J:=Input("Months per Frame (0=Weekly)",0,12,1); J:=If(5>J OR Mod(J,3)=0 AND (9>J OR J>9),Int(J),1); Q:=Input("Mode, 0=Static 1=Dynamic 2=Delayed",0,2,2); {Update on last bar, new bar or new frame} {Timing} {Day counter by metastocktools.com} D:=DayOfWeek();M:=Month();Y:=Year(); Z:=Cum(1);F:=Rnd(Life(291231)); M:=If(J=0,ValueWhen(1,Z=1,F+D-1)-F, (Y-ValueWhen(1,Z=1,Y))*12+M); I:=If(J=0,Int(M/7),Int((M-1)/Max(1,J))); I:=I>ValueWhen(2,1,I); G:=LastValue(Lowest(Sum(I>0,5))=5); I:=ExtFml("Forum.Sum",I,1);M:=G+I; F:=ExtFml("Forum.Sum",Ref(I,1),1)*(M=0)*(Z>1)+G; B:=LastValue(Z);A:=B-1=Z;B:=B=Z; F:=F+B*(Q=0)*(J=0)*(D=5); J:=If(F,1,(Alert(F,2)=0)*M*2*(Z>1)); J:=If(A+LastValue(J)>2 OR B+(Q=1)=2,1,J); J:=If(G,1,If(Q=2,M*2,J)); {Period HHV & LLV prices} K:=If(N=0,H,If(N=1,L,C)); B:=HighestSince(1,M+(Z=1),If(N=3,H,K)); Y:=LowestSince(1,M+(Z=1),If(N=3,L,K)); B:=ValueWhen(1,J,If(J=1,B,ValueWhen(2-G,1,B))); Y:=ValueWhen(1,J,If(J=1,Y,ValueWhen(2-G,1,Y))); ValueWhen(1,B>0,B); ValueWhen(1,Y>0,Y); Roy
Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.