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

Notification

Icon
Error

Options
Go to last post Go to first unread
minnamor  
#1 Posted : Friday, April 29, 2005 9:37:56 AM(UTC)
minnamor

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 4/27/2005(UTC)
Posts: 126
Location: Italy

I am trying to implement the system described in TASC Feb 2005 Vol. 23 N. 2 in the article "The Truth about volatility" by Jim Berg. He specifies 3 conditions for defining an uptrend: 1. higher highs and higher lows on a weekly chart (taken care of with ExtFml("PowerPivots.TrendDirection",1,2)), 2. closing pricesabove the 34 week moving average, and 3. 34 week moving average is rising. I have difficulty with the last two conditions. I copied the following formulae for weekly data: SMA: {© 2004 Roy Larsen, rlarsen@man.quik.co.nz} {for use on daily charts with Jose Silva's "Calendar Week counter"} N:=Input("Weekly SMA - Close Periods",1,99,10); F:=Input("End of Week, 5=Friday 6=Saturday 7=Sunday",5,7,5); Q:=Input("Display Mode, 0=Static 1=Dynamic 2=Test",0,2,2); {0=Display, update on Friday when possible} {1=Display, update on each new bar} {2=Backtest, update on first bar of new week} G:=LastValue(Highest(Sum(DayOfWeek()=F,5))=5); I:=Fml("Calendar Week counter"); I:=Abs(I-ValueWhen(2-G,1,I)); M:=G OR I>0; F:=G OR (DayOfWeek()=F AND I=0); A:=LastValue(Cum(1)-1)=Cum(1); B:=LastValue(Cum(1))=Cum(1); J:=If(F,1,If(Alert(F,2)=0 AND M,2,0)); J:=If(A+LastValue(J)>2 OR B+(Q=1)=2,1,J); J:=If(G,1,If(Q=2 OR Cum(J)<=1,M*2,J)); K:=ValueWhen(1,J,If(J=1,C,ValueWhen(2-G,1,C))); X:=Cum((J>0)*K); (X-ValueWhen(N+1,J,X))/N; I tried to write the three conditions as follows (I hoped to be able to change inputs where different from the default value as shown below leaving all other inputs unchanged): ExtFml("PowerPivots.TrendDirection",1,2)=1 AND FmlVar("Custom - Weekly SMA - Close","N") =34; C> Fml( "Custom - Weekly SMA - Close") AND Fml( "Custom - Weekly SMA - Close")>Ref(Fml( "Custom - Weekly SMA - Close"),-1) Unfortunately, the result is not consistent with the visual inspecton of the indicators drawn on the price chart. I tried the PowerPivot T-Average function but it would not accept arguments after the function name. Can you help me solve this problem? Thanks.
Patrick  
#2 Posted : Sunday, May 1, 2005 12:31:45 AM(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)
Sorry did not read the article, never saw this formula ... Here is what I would try : {© 2004 Roy Larsen, rlarsen@man.quik.co.nz} {for use on daily charts with Jose Silva's "Calendar Week counter"} N:=34; F:=5; Q:=2; G:=LastValue(Highest(Sum(DayOfWeek()=F,5))=5); I:=Fml("Calendar Week counter"); I:=Abs(I-ValueWhen(2-G,1,I)); M:=G OR I>0; F:=G OR (DayOfWeek()=F AND I=0); A:=LastValue(Cum(1)-1)=Cum(1); B:=LastValue(Cum(1))=Cum(1); J:=If(F,1,If(Alert(F,2)=0 AND M,2,0)); J:=If(A+LastValue(J)>2 OR B+(Q=1)=2,1,J); J:=If(G,1,If(Q=2 OR Cum(J)<=1,M*2,J)); K:=ValueWhen(1,J,If(J=1,C,ValueWhen(2-G,1,C))); X:=Cum((J>0)*K); Value:=(X-ValueWhen(N+1,J,X))/N; ExtFml("PowerPivots.TrendDirection",1,2)=1 AND C>Value AND ROC(Value,1,$)>0
minnamor  
#3 Posted : Monday, May 2, 2005 8:54:34 AM(UTC)
minnamor

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 4/27/2005(UTC)
Posts: 126
Location: Italy

As often, the cause of the mistake was under my eyes. The weekly functions plotted on daily charts generate step lines. Acordingly, the ROC function referred to one week should be based on 5 days ( :wink: ) and not one period. Thanks.
pkatta  
#4 Posted : Sunday, August 14, 2005 5:47:11 PM(UTC)
pkatta

Rank: Newbie

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

Minnamor, Would it be possible for you to post the final version of the formulae you wrote to implement the article "Truth about volatility". I appreciate you taking the time to post this. Thanks again.
minnamor wrote:
As often, the cause of the mistake was under my eyes. The weekly functions plotted on daily charts generate step lines. Acordingly, the ROC function referred to one week should be based on 5 days ( :wink: ) and not one period. 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.