[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] John Ehler's Relative Vigor Index.



PureBytes Links

Trading Reference Links

Hi, I tried to implemement John Ehler's RVI, stoRVI and FisherRVI,
however the arrays always resulting EMPTY.  Can someone help?  TIA

FIG 8.8 Pg 84

/* Relative Vigour Index from TASC 01/02 */

SetBarsRequired(200, 0);

//period = 14;
Period = Param("Period", 10, 1, 250, 1); // window should be half of
dominant cycle length
stoLen = Period; // Param("stoLen", 8, 1, 50, 1); // window should be
half of dominant cycle length

value1 = ( ( Close - Open ) + ( 2 * Ref( Close - Open, -1) ) + ( 2 *
Ref( Close - Open, -2) ) + Ref( Close - Open, -3) ) / 6;
value2 = ( ( High - Low ) + ( 2 * Ref( High - Low, -1) ) + ( 2 * Ref(
High - Low, -2) ) + Ref( High - Low, -3) ) / 6;

num   = Sum( value1, period );
denom = Sum( value2, period );

RVI    = IIf( denom != 0, num / denom, 0);
RVISig = ( RVI + 2 * Ref( RVI, -1) + 2 * Ref( RVI, -2) + Ref( RVI, -3)
) / 6;

MinRVI = LLV(RVI,stoLen);
MaxRVI = HHV(RVI,stoLen);

Value3 = IIf(MaxRVI != MinRVI, (RVI - MinRVI) / (MaxRVI - MinRVI), 0);
Value4 = (4*Value3 + 3*Value3[1] + 2*Value3[2] + Value3[3]) / 10;  //
weighted averages.

Value5 = 2*(Value4 - 0.5);


FisherStoRVI = 0.5 * log((1+1.98*(Value4 - 0.5))/(1-1.98*(Value4 - 0.5)));

Plot(RVI   , "Ehlers RVI(" + Period + ")", colorBlue, styleLine);
Plot(Ref(RVI,-1), "Ehlers RVI-Trig", colorRed, styleLine);

Plot(Value5, "Ehlers stoRVI(" + stoLen + ")", colorViolet, styleLine +
styleOwnScale);
Plot(0.96*(Ref(Value5,-1)+0.02), "Ehlers StoRVI triggers" ,
colorBrown, styleLine + styleOwnScale);

Plot(FisherStoRVI , "Ehlers Fisher stoRVI", colorTeal, styleLine +
styleOwnScale);
Plot(0.96*(Ref(FisherStoRVI ,-1)+0.02), "Ehlers Fisher StoRVI
triggers" , colorViolet, styleLine + styleOwnScale);

Plot(0,"",colorLightGrey,styleLine);






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Help tsunami villages rebuild at GlobalGiving. The real work starts now.
http://us.click.yahoo.com/njNroD/KbOLAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/