Stochastic RSI (STOCH RSI)
Indicator that uses a Stochastic formula on a set of RSI values to measure momentum and determine if an asset is overbought or oversold.
Last updated
Indicator that uses a Stochastic formula on a set of RSI values to measure momentum and determine if an asset is overbought or oversold.
Last updated
// Prints the current value of a 20 period Stochastic RSI using
// the daily bars close price value.
stochRsi = indicators.StochasticRSI(20).OnSeries(dailyBars.Close);
Log(stochRsi.Value.ToString());
// Evaluates if the current bar Stochastic RSI value is greater than
// the value one bar ago.
stochRsi = indicators.StochasticRSI(20).Keep(2).OnSeries(dailyBars.Close);
if (stochRsi.Values[0] > stochRsi.Values[1]) {
Log("Stochatic RSI is rising.");
}using Signals.DataSeries.Bars;
using Signals.Framework;
using Signals.Indicators.StochasticRSI;
public class MyStrategy : SingleMarketStrategy
{
private Bars dailyBars;
private StochasticRSI stochRsi;
public override void Setup(DataMarketplace data, IndicatorsMarketplace indicators)
{
dailyBars = data.Bars(BarPeriodType.Day, 1).WithOffset(25);
stochRsi = indicators.StochasticRSI(20).Keep(2).OnSeries(dailyBars.Close);
}
public override void RegisterActions()
{
OnUpdateOf(dailyBars).Do(() =>
{
Log(stochRsi.Value.ToString());
if (stochRsi.Values[0] > stochRsi.Values[1]) {
Log("Stochatic RSI is rising.");
} else {
Log("Stochatic RSI is descending.");
}
});
}
}