Is anyone aware of a way to get the RVI indicator for MultiCharts?
Thanks
Code for RVI
- TJ
- Posts: 7744
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2223 times
Re: Code for RVI
are you referring to the Relative Vigor Index (Ehlers)?Is anyone aware of a way to get the RVI indicator for MultiCharts?
Thanks
or the Relative Volatility Index?
-
- Posts: 100
- Joined: 17 Jul 2009
- Location: Germany
Function: RVI
Function: AdaptiveRVI
Function: RVIStochastic
Code: Select all
Inputs: Length(NumericSimple);
Vars: Num(0),
Denom(0),
Count(0),
RVI(0),
Trigger(0);
Value1 = ((Close - Open) + 2*(Close[1] - Open[1]) + 2*(Close[2] - Open[2]) + (Close[3] - Open[3]))/6;
Value2 = ((High - Low) + 2 * (High[1] - Low[1]) + 2 * (High[2] - Low[2]) + (High[3] - Low[3]))/6;
Num = 0;
Denom = 0;
For count = 0 to Length -1 begin
Num = Num + Value1 [count];
Denom = Denom + Value2[count];
End;
If Denom <> 0 then RVI = Num / Denom;
Function: AdaptiveRVI
Code: Select all
Inputs: Price(numericseries), Len(numericsimple);
var:alpha(.07);
Vars: Smooth(0),Cycle(0),Q1(0),I1(0),DeltaPhase(0),MedianDelta(0),DC(0),InstPeriod(0),Period(0),
Count(0),Length(0),Num(0),Denom(0),RVI(0),MaxRVI(0),MinRVI(0);
alpha=Len/7142;
Smooth = (Price + 2*Price[1] + 2*Price[2] + Price[3])/6;
Cycle=(1-.5*alpha)*(1-.5*alpha)*(Smooth-2*Smooth[1]+Smooth[2])+2*(1-alpha)*Cycle[1]-(1-alpha)*(1-alpha)*Cycle[2];
If currentbar<7 then Cycle = (Price-2*Price[1]+Price[2])/4;
Q1=(.0962*Cycle+.5769*Cycle[2]-.5769*Cycle[4]-.0962*Cycle[6])*(.5+.08*InstPeriod[1]);
I1 = Cycle[3];
If Q1<>0 and Q1[1]<>0 then DeltaPhase=(I1/Q1-I1[1]/Q1[1])/(1+I1*I1[1]/(Q1*Q1[1]));
If DeltaPhase <0.1 then Deltaphase = 0.1;
If DeltaPhase >1.1 then Deltaphase = 1.1;
MedianDelta = Median(DeltaPhase,5);
If MedianDelta = 0 then DC = 15 else DC = 6.28318/MedianDelta + .5;
InstPeriod = .33*DC + .67*InstPeriod[1];
Period = .15*InstPeriod+.85*Period[1];
Length = intportion((4*Period+3*Period[1]+2*Period[3]+Period[4])/20);
Value1=((Close-Open)+2*(Close[1]-Open[1])+2*(Close[2]-Open[2])+(Close[3]-Open[3]))/6;
Value2=((High-Low)+2*(High[1]-Low[1])+2*(High[2]-Low[2])+(High[3]-Low[3]))/6;
Num = 0;
Denom = 0;
For Count = 0 to Length - 1 begin
Num = Num + Value1[count];
Denom = Denom + Value2[count]; End;
If Denom <> 0 then RVI = Num/Denom;
AdaptiveRVI=RVI *50 +50;
Function: RVIStochastic
Code: Select all
input: Length(numericsimple);
Var {Inputs}: delimiter(80);
Vars: Num(0),Denom(0),count(0),RVI(0),MaxRVI(0),MinRVI(0);
Value1 = ((Close - Open) + 2*(Close[1] - Open[1]) + 2*(Close[2] - Open[2]) + (Close[3] - Open[3]))/6;
Value2 = ((High - Low) + 2*(High[1] - Low[1]) + 2*(High[2] - Low[2]) + (High[3] - Low[3]))/6;
Num = 0; Denom = 0;
For count = 0 to Length - 1 begin
Num = Num + Value1[count];
Denom = Denom + Value2[count];
End;
If Denom <> 0 then RVI = Num / Denom;
MaxRVI = Highest(RVI, Length);
MinRVI = Lowest(RVI, Length);
If MaxRVI <> MinRVI then Value3 = (RVI - MinRvi) / (MaxRVI - MinRVI);
Value4 = (4*Value3 + 3*Value3[1] + 2*value3[2] + Value3[3]) / 10;
Value4 = 2*(Value4 - .5);
RVIStochastic=Value4 *50 +50;
- TJ
- Posts: 7744
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2223 times
Relative Vigor Index (Ehlers)
Relative Vigor Index (Ehlers)
- Attachments
-
- RVI.doc
- (62.5 KiB) Downloaded 621 times
-
- Posts: 159
- Joined: 20 Nov 2010
- Location: France
- Has thanked: 76 times
- Been thanked: 34 times
Re: Code for RVI
Thanks a lot Geektrader for the code!
How do you prefer to use them ?
With a signal line? with supports/resistances on the charts? as an oscillator?
Is there documentation about it?
How do you prefer to use them ?
With a signal line? with supports/resistances on the charts? as an oscillator?
Is there documentation about it?
-
- Posts: 159
- Joined: 20 Nov 2010
- Location: France
- Has thanked: 76 times
- Been thanked: 34 times
Re: Code for RVI
In both case, the code posted is for the Relative Vigor Index.
Has someone coded the Relative Volatility Index?
For eSignal, the formula is there:
https://www.multicharts.com/support/bas ... le&id=1801
For Metastock, there:
http://trader.online.pl/MSZ/e-w-Relativ ... x_RVI.html
For TS, I have found this code, but do not think it's okay (with the loop).
http://freeforumzone.leonardo.it/discus ... dd=2132917
Has someone coded the Relative Volatility Index?
For eSignal, the formula is there:
https://www.multicharts.com/support/bas ... le&id=1801
For Metastock, there:
http://trader.online.pl/MSZ/e-w-Relativ ... x_RVI.html
For TS, I have found this code, but do not think it's okay (with the loop).
http://freeforumzone.leonardo.it/discus ... dd=2132917
- TJ
- Posts: 7744
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2223 times
Re: Code for RVI
there you go...
Relative Volatility Index
and
RVII function
(numeric, autodetect)
Relative Volatility Index
and
RVII function
(numeric, autodetect)
- Attachments
-
- RVII.txt
- RVII function
- (788 Bytes) Downloaded 816 times
-
- Relative Volatility Index.txt
- Relative Volatility Index
- (690 Bytes) Downloaded 826 times
- TJ
- Posts: 7744
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2223 times