Rank: Member
Groups: Registered, Registered Users Joined: 6/8/2005(UTC) Posts: 10 Location: Sydney Australia
|
Hi all,
I have this formula of the Relative Volatility Index Indicator:
rv:=Input("RVI Periods :",-50,200,14);
rvb:=Input("RVI Lookback Periods :",-50,200,13);
rvs:=Input("STD Deviation Periods :",-50,200,10);
RVID:=((PREV*rvb)+If(ROC(C,1,%)<0,Stdev(C,rvs),0))/rv;
RVIu:=((PREV*rvb)+If(ROC(C,1,%)>0,Stdev(C,rvs),0))/rv;
RVIall := ( 100 * RVIU ) / ( RVIU + RVID);
rviall;
But it does not display the same values as the built in Metastock RVI indicator (By Donald Dorsey) in Metastock.
Is there another formulae for the RVI that will display correctly?
Anne
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 10/28/2004(UTC) Posts: 3,111 Location: Perth, Western Australia
Was thanked: 16 time(s) in 16 post(s)
|
Anne,
I havent got this one figured out just yet, but my research (I read the MS User Manual again) shows the correct formula should be:
rv:=Input("RVI Periods :",0,200,14);
rvs:=Input("STD Deviation Periods:",0,200,10);
U:=Wilders(If(ROC(C,1,$)>0,Stdev(C,rvs),0),rv);
D:=Wilders(If(ROC(C,1,$)<0,Stdev(C,rvs),0),rv);
100-(100/(1+(U/D)));
which is exactly equal to the post you showed, with the exception of the very first few bars where there is a small 'seeding' error between your indicator and mine - most probably due to the use of the PREV function.
Why this is not the same as the inbuilt indicator I do not know - but there were two versions initally offered by Dorsey, one in 1993 and another in 1995. Maybe this is the difference?
I will keep working on it - its an interesting problem....
wabbit :D
|
|
|
|
Rank: Member
Groups: Registered, Registered Users Joined: 6/8/2005(UTC) Posts: 10 Location: Sydney Australia
|
Thankyou Wabbit,
I have Modified the code slightly and the indicator is almost the same as the built in metastock one.
I have emailed Metstock customer support for the code which is used for the built in Metastock RVI Indicator.
Do not have any response as yet?
I recall paying in excess of $3000.00 for my Metastock Pro and the Resellers promoting the issue of Free lifetime support from Equis.
I must admitt, when I do get support it is good.
But trying to get support is another issue alltogether.
rv:=Input("RVI Periods :",-50,200,14);
rvb:=Input("RVI Lookback Periods :",-50,200,13);
rvs:=Input("STD Deviation Periods :",-50,200,10);
RVID:=((PREV*rvb)+If(ROC(H,1,%)<0,Stdev(C,rvs),0))/rv;
RVIu:=((PREV*rvb)+If(ROC(L,1,%)>0,Stdev(C,rvs),0))/rv;
{rviall:=(rvid+rviu)/2;
RVIall := ( 100 * RVId ) / ( RVIU + RVID);}
rviall:=(100*rviu)/(rviu+rvid);
rviall;
Anne :D
|
|
|
|
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)
|
Anne,
Formulae support is a whole other animal ;)
Not that many people can write formulae, and when then can they usually do not want to work in support ... This might answer that ...
Patrick :mrgreen:
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users Joined: 6/16/2007(UTC) Posts: 2
|
Hi Anne,
Your original code is for the 1993 version. The 1995 version = [(RVI of Highs) + (RVI of Lows)] / 2
The MS code is:
Periods:=Input("RVI Periods :",-50,200,14); SdevPer:=Input("STD Deviation Periods :",-50,200,10);
RVIDownH := ((PREV*(Periods-1))+If(ROC(H,1,%)<0,Stdev(H,SdevPer),0))/Periods; RVIUpH := ((PREV*(Periods-1))+If(ROC(H,1,%)>0,Stdev(H,SdevPer),0))/Periods; RVIH := ( 100 * RVIUpH ) / ( RVIUpH + RVIDownH);
RVIDownL := ((PREV*(Periods-1))+If(ROC(L,1,%)<0,Stdev(L,SdevPer),0))/Periods; RVIUpL := ((PREV*(Periods-1))+If(ROC(L,1,%)>0,Stdev(L,SdevPer),0))/Periods; RVIL := ( 100 * RVIUpL ) / ( RVIUpL + RVIDownL);
RVIall := (RVIL + RVIH) /2;
RVIall;
This gives me exactly the same values as the built in RVI.
Jaime
|
|
|
|
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.