Log in to see Cloud of Tags

Wealth-Lab Wiki

Syntax

public RAVI(DataSeries ds, int periodFast, int periodSlow, bool useSMA, bool useAbsolute, string description)
public static RAVI Series(DataSeries ds, int periodFast, int periodSlow, bool useSMA, bool useAbsolute)

Parameter Description

dsDataSeries
periodFastFast moving average period (default: 7)
periodSlowSlow moving average period (default: 65)
useSMAUse SMA (default) or EMA for the calculation
useAbsoluteTake the absolute value of the result (default) as per the book by Tushar Chande or preserve trend direction

Description

Chande's Range Action Verification Index (RAVI) indicator was developed by Tushar Chande. It's used to identify whether a market is trending. The RAVI indicator is calculated using two moving averages, fast and slow. The first one is a short moving average with a lookback period of 7 bars. The second one is a long moving average with a lookback period of 65 bars. The indicator returns a percentage value. Above a certain threshold, the market is considered trending.

References:


Example

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

namespace WealthLab.Strategies { public class RAVI_ : WealthScript { protected override void Execute() { var ravi = RAVI.Series(Close, 7, 65, true, true);

ChartPane p = CreatePane(30, false, false); HideVolume(); PlotSeries(p, ravi, Color.Black, LineStyle.Solid, 3); DrawHorzLine(p, 3, Color.Blue, LineStyle.Dashed, 1); DrawHorzLine(p, -3, Color.Red, LineStyle.Dashed, 1);

for(int bar = 1; bar < Bars.Count; bar++) { SetSeriesBarColor(bar, ravi, (ravi[bar] > ravi[bar-1]) ? Color.Green : Color.Red); } } } }

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.