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

Notification

Icon
Error

Options
Go to last post Go to first unread
wuming79  
#1 Posted : Monday, September 14, 2009 3:26:26 AM(UTC)
wuming79

Rank: Member

Groups: Registered, Registered Users
Joined: 8/23/2008(UTC)
Posts: 25
Location: Singapore

I was going through some exercises in Metastock Primer and I have this question below.

Question: Suppose you wanted to vary the ROC() function based on the RSI. When the 14-period RSI is getting near its overbought and oversold regions, the rate of change might be far more important then when the RSI is in its mid-ranges. Taking such a premise as truth, you might wish to use a 1-period rate of change in the overbought and oversold ranges and a 3 period rate of change elsewhere. Write a forumla to do this and name it Variable ROC Average. Use the same 20-Period moving average and treat values above 70 and below 30 as overbought and oversold ranges.

My answer was this:
If((RSI(14)>70) OR (RSI(14)<30),Mov(ROC(C,1,$),20,S), Mov(ROC(C,3,$),20,S))

This is the correct answer:
Mov((If(RSI(14)>70 OR RSI(14)<30,ROC(C,1,$),ROC(C,3,$))),20,S)

I thought they are logically the same but the graph produced are quite different. They should be doing MOV(ROC(C,1,$),20,S) if it is RSI(14)>70) OR (RSI(14)<30 else Mov(ROC(C,3,$),20,S) right?
What is the difference between the 2 code? Why did they display differently on the chart? Pls help.
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.