---
id: "M:cAlgo.API.Internals.IIndicatorsAccessor.RelativeVigorIndex(System.Int32)"
kind: "method"
type: "T:cAlgo.API.Internals.IIndicatorsAccessor"
url: "https://help.ctrader.com/ctrader-algo/references/Indicators/IIndicatorsAccessor/RelativeVigorIndex/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# IIndicatorsAccessor.RelativeVigorIndex

Member of [IIndicatorsAccessor](https://help.ctrader.com/ctrader-algo/references/Indicators/IIndicatorsAccessor/index.md).

## RelativeVigorIndex(int periods)

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

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
RelativeVigorIndex RelativeVigorIndex(int periods)
```

Python:

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

### Parameters

- `periods` (`int`, Python `int`): Moving Average Period

### Returns

`RelativeVigorIndex` — RelativeVigorIndex

### Examples

C#:

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

Python:

```python
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.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
RelativeVigorIndex RelativeVigorIndex(Bars bars, int periods)
```

Python:

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

### Parameters

- `bars` (`Bars`, Python `Bars`): The Bars that will be used by indicator, you can pass another timeframe/symbol bars
- `periods` (`int`, Python `int`): Moving Average Period

### Returns

`RelativeVigorIndex` — RelativeVigorIndex

### Examples

C#:

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

Python:

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

