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

Notification

Icon
Error

Options
Go to last post Go to first unread
StorkBite  
#1 Posted : Wednesday, May 4, 2005 2:12:05 PM(UTC)
StorkBite

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 3/19/2005(UTC)
Posts: 2,995

Was thanked: 14 time(s) in 10 post(s)
Hi All- Being new to metastock formulas, I wanted to make sure that the correct formula for 52 wk high is HHV(H,255); and, that for the 52 wk low is LLV(L,255). I have seen some software use 250 periods, others 255 or 260. By my own calculation there will be 252 trading days in 2005. Is there a standard number of periods that should be used? Thanks!
Patrick  
#2 Posted : Wednesday, May 4, 2005 2:27:38 PM(UTC)
Patrick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 9/8/2004(UTC)
Posts: 2,266

Was thanked: 1 time(s) in 1 post(s)
Yes this would be a correct formula. Now the 250 or 255 periods, it does not matter ... If you wanted the years low or high, take a look at this formula : lowestsince(1,roc(year(),1,$)<>0,L); Highestsince(1,roc(year(),1,$)<>0,H) Patrick
Jose  
#3 Posted : Wednesday, May 4, 2005 4:28:01 PM(UTC)
Jose

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 1/19/2005(UTC)
Posts: 1,065
Location: Koh Pha-Ngan, Earth

Was thanked: 2 time(s) in 2 post(s)
A 252-period HHV/LLV on a chart with only 100 bars of data for the past year, will result in approximately a 2.5 year High/Low instead. So, for a true 52-week High & Low, regardless of missing chart data: [code:1:93cfdec1fe] { True 52-week Highs & Lows } { http://www.metastocktools.com } { User input } plot:=Input("plot: [1]52Week Hi/Lo, [2]Signals",1,2,1); { Last available data date } day:=LastValue(DayOfMonth()); mth:=LastValue(Month()); yr:=LastValue(Year()); { True last 52-week period } active:=Year()>yr-1 OR (Year()=yr-1 AND (Month()>mth OR Month()=mth AND DayOfMonth()>=day)); start:=active AND Alert(active=0,2); { 52-week Highs } YearHi:=HighestSince(1,start,H); YearHiSignals:=H>Ref(YearHi,-1); { 52-week Lows } YearLo:=LowestSince(1,start,L); YearLoSignals:=L<Ref(YearLo,-1); { Plot on price chart } If(plot=1,YearHi,YearHiSignals); If(plot=1,YearLo,-YearLoSignals) [/code:1:93cfdec1fe] jose '-) http://www.metastocktools.com
StorkBite  
#4 Posted : Wednesday, May 4, 2005 4:46:42 PM(UTC)
StorkBite

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 3/19/2005(UTC)
Posts: 2,995

Was thanked: 14 time(s) in 10 post(s)
Yea... missing data... can't forget about that. LOL! 8) Seriously Jose, I got your formula to work fine. Thanks for your response. All the feedback is what makes this forum so interesting. I'm going to integrate this into some of my explorations. Hopefully others will be able to use it too. Thanks!
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.