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

Notification

Icon
Error

Options
Go to last post Go to first unread
drobato  
#1 Posted : Tuesday, August 23, 2005 3:37:03 AM(UTC)
drobato

Rank: Newbie

Groups: Registered, Registered Users
Joined: 8/2/2005(UTC)
Posts: 8

The Custom Formulas section of the MetaStock website lists the following under MACD Histogram. https://www.metastock.com/Customer/Resources/Formulas/?c=&p=&i=&Id=326e0f21]Mov(If(DayOfWeek()=5,C,Peak(1,If(DayOfWeek()=5,C,0),1)),60,E) - Mov(If(DayOfWeek()=5,C,Peak(1,If(DayOfWeek()=5,C,0),1)),130,E) - Mov(Mov(If(DayOfWeek()=5,C,Peak(1,If(DayOfWeek()=5,C,0),1)),60,E) - Mov(If(DayOfWeek()=5,C,Peak(1,If(DayOfWeek()=5,C,0),1)),130,E),45,E)[/code:1:08186e0f21] This code is not entirely self explanatory to me. I re-wrote it a bit to try and get a handle on it. Here's my version. [code:1:08186e0f21]WeeklyClose := Peak(1,If(DayOfWeek()=5,C,0),1); WeeklyMACD := Mov(If(DayOfWeek()=5,C,WeeklyClose),60,E) - Mov(If(DayOfWeek()=5,C,WeeklyClose),130,E); WeeklyMACD - Mov(WeeklyMACD,45,E)[/code:1:08186e0f21] I believe I misnamed the variable WeeklyClose and do not entirely understand what the Peak function is trying to do here. First off it seems to me we already know that DayOfWeek() does not equal 5. Because if it does we will not evalauate WeeklyClose in the first place. Rather C will be returned instead. So why is this replicated in the Peak function call? It seems to me the call to Peak is trying to deal with the boundary condition of the last week in the series which may not include a full week. Is this correct? If so it appears to me that this code mishandles the boundary condition. Shouldn't it just return the Close for today? I guess the bottom line is I don't understand the theory behind this version of weekly MACD from daily data. TIA
Patrick  
#2 Posted : Tuesday, August 23, 2005 2:50:23 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)
Quote:
It seems to me the call to Peak is trying to deal with the boundary condition of the last week in the series which may not include a full week. Is this correct? If so it appears to me that this code mishandles the boundary condition. Shouldn't it just return the Close for today?
That's exactly it ... There are better weekly formulae out there, check Jose's website : http://metastocktools.com http://metastocktools.com/MetaStock/EMA-Weekly.txt with this you should be able to come up with a better Weekly MACD. Patrick :mrgreen:
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.