RelativeStrengthIndex


Summary

The Relative Strength Index indicator measures turns in price by measuring turns in momentum.

Syntax

public RelativeStrengthIndex RelativeStrengthIndex(DataSeries source, int periods)

Parameters

NameDescription

Example 1

[Parameter]
public DataSeries Source { get; set; }
[Parameter(DefaultValue = 20)]
public int Period { get; set; }
private RelativeStrengthIndex rsi;
protected override void OnStart()
{
    rsi = Indicators.RelativeStrengthIndex(Source, Period);
}
protected override void OnBar()
{
    if (rsi.Result.LastValue > 70)
    {
        Print("RSI is higher than 70");
    }
}