Log in to see Cloud of Tags

Wealth-Lab Wiki

Syntax

public RVI(Bars bars, int period, string description)
public static RVI Series(Bars bars, int period)

Parameter Description

bars The Bars object
period Indicator calculation period

Description

RVI returns the Relative Vigor Index, and indicator created by John Ehlers of Mesa Software). RVI measures the average difference between closing and opening price, normalized to the average daily trading range. It applies a normalization filter to smooth the index with minimal lag.

Interpretation

RVI reaches extreme high and low levels near the peaks of uptrends and downtrends. You can trigger signals based on these extreme levels, or wait until RVI crosses above or below a signal line.

The RVI indicator accepts a parameter that determines the Period to use in its calculation. You can create a dynamic RVI that is based on half of the dominant cycle period as described by Ehlers. Below we create a custom Price Series and populate with the RVI values based on half of the cycle period as determined by the HTPeriod indicator.

Example

using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using WealthLab;
using WealthLab.Indicators;

namespace WealthLab.Strategies { public class MyStrategy : WealthScript { protected override void Execute() { DataSeries rvi = RVI.Series( Bars, 10 ); ChartPane RVIPane = CreatePane( 50, true, true ); PlotSeries( RVIPane, rvi, Color.DarkBlue, LineStyle.Solid, 1 ); for(int bar = rvi.FirstValidValue; bar < Bars.Count; bar++) { for(int p = ActivePositions.Count - 1; p >= 0; p--) { Position pos = ActivePositions[p]; if( CrossOver( bar, rvi, 0.35 ) ) SellAtMarket( bar+1, pos ); } if( ( TurnUp( bar, rvi ) ) & ( rvi[bar-1] < -0.35 ) ) BuyAtMarket( bar+1 ); } } } }

Important Disclaimer: The information provided by Wealth-Lab is strictly for informational purposes and is not to be construed as advice or solicitation to buy or sell any security.  The owner of Wealth-Lab.com assumes no liability resulting from the use of the material contained herein for investment purposes. By using this web site, you agree to the terms of this disclaimer and our Terms of Use.


ScrewTurn Wiki. Some of the icons created by FamFamFam.