Relative Strength Index (RSI)
A momentum indicator that measures the speed and magnitude of the recent price changes of an asset, to determine if it has been overbought or oversold.
Last updated
A momentum indicator that measures the speed and magnitude of the recent price changes of an asset, to determine if it has been overbought or oversold.
Last updated
// Prints the current value of a 20 period RSI using
// the daily bars close price value.
rsi = indicators.RSI(20).OnSeries(dailyBars.Close);
Log(rsi.Value.ToString());
// Evaluates if the current bar RSI value is greater than
// the value one bar ago.
rsi = indicators.RSI(20).Keep(2).OnSeries(dailyBars.Close);
if (rsi.Values[0] > rsi.Values[1]) {
Log("RSI is rising.");
}using Signals.DataSeries.Bars;
using Signals.Framework;
using Signals.Indicators.RSI;
public class MyStrategy : SingleMarketStrategy
{
private Bars dailyBars;
private RSI rsi;
public override void Setup(DataMarketplace data, IndicatorsMarketplace indicators)
{
dailyBars = data.Bars(BarPeriodType.Day, 1).WithOffset(25);
rsi = indicators.RSI(20).OnSeries(dailyBars.Close);
}
public override void RegisterActions()
{
OnUpdateOf(dailyBars).Do(() =>
{
Log(rsi.Value.ToString());
});
}
}