Skip to content

IIndicatorsAccessor.RelativeVigorIndex

method · IIndicatorsAccessor · cAlgo.API.Internals

DesktopCLICloud

The Relative Vigor Index is a momentum oscillator, measuring the strength of a trend.

Overloads

RelativeVigorIndex(int periods)

The Relative Vigor Index is a momentum oscillator, measuring the strength of a trend.

RelativeVigorIndex RelativeVigorIndex(int periods)
api.Indicators.RelativeVigorIndex(periods: int) -> RelativeVigorIndex

Parameters

Name C# type Python type Description
periods int int Moving Average Period

Returns RelativeVigorIndex — RelativeVigorIndex

Examples

var rvi = Indicators.RelativeVigorIndex(10);
if (rvi.Result.HasCrossedAbove(rvi.Signal, 0))
    Print("Relative Vigor Index crossed above its signal line");
rvi = api.Indicators.RelativeVigorIndex(10)
if Functions.HasCrossedAbove(rvi.Result, rvi.Signal, 0):
    api.Print("Relative Vigor Index crossed above its signal line")

RelativeVigorIndex(Bars bars, int periods)

The Relative Vigor Index is a momentum oscillator, measuring the strength of a trend.

RelativeVigorIndex RelativeVigorIndex(Bars bars, int periods)
api.Indicators.RelativeVigorIndex(bars: Bars, periods: int) -> RelativeVigorIndex

Parameters

Name C# type Python type Description
bars Bars Bars The Bars that will be used by indicator, you can pass another timeframe/symbol bars
periods int int Moving Average Period

Returns RelativeVigorIndex — RelativeVigorIndex

Examples

var dailyBars = MarketData.GetBars(TimeFrame.Daily);
var dailyRvi = Indicators.RelativeVigorIndex(dailyBars, 10);
Print("Daily RVI: {0}, signal: {1}", dailyRvi.Result.LastValue, dailyRvi.Signal.LastValue);
dailyBars = api.MarketData.GetBars(TimeFrame.Daily)
dailyRvi = api.Indicators.RelativeVigorIndex(dailyBars, 10)
api.Print(f"Daily RVI: {dailyRvi.Result.LastValue}, signal: {dailyRvi.Signal.LastValue}")