Syntax
public static StochRSI Series(DataSeries source, int period)
public StochRSI(DataSeries source, int period, string description)
Parameter Description
source |
Price series |
period |
Indicator calculation period |
Description
StochRSI is an indicator created by Tushar Chande that combines Stochastics with the
Relative Strength Index. Like
RSI, StochRSI cycles between overbought levels below 30 and oversold levels above 70. The StochRSI reaches these levels much more frequently than
RSI, resulting in an oscillator that offers more trading opportunities. StochRSI moves within the range of 0 to 100. Unlike
RSI, StochRSI frequently reaches the extreme 0 and 100 levels.
Interpretation
- Look for oversold levels below 30 and overbought levels above 70. These normally occur before the underlying price chart forms a top or a bottom. Note, you should change the levels depending on market conditions. Ensure the level lines cut across the highest peaks and the lowest troughs. During strong trends the StochRSI may remain in overbought or oversold for extended periods.
- If underlying prices make a new high or low that isn't confirmed by the StochRSI, this divergence can signal a price reversal. StochRSI divergences from price indicates very strong buy or sell signal.
- Swing Failures. If the StochRSI makes a lower high followed buy a downside move below a previous low, then a Top Swing Failure has occurred, sell signal. If the StochRSI makes a higher low followed buy a upside move above a previous high, then a Bottom Swing Failure has occurred, buy signal.
- The mid point level of 50 will often act as support or resistance if the StochRSI bounce off the 50 level. Crosses of the 50 level can be used as a buying or selling signal. When StochRSI cross above then buy, when StochRSI crosses below then sell.
Calculation
StochRSI is essentially a StochK of the
RSI. See both
StochK and
RSI for more information.
StochRSI = ( RSI(n) - RSI lowest low(n) ) / ( RSI highest high(n) - RSI lowest low(n) )
where, n = number of periods
Example
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using WealthLab;
using WealthLab.Indicators;
namespace WealthLab.Strategies
{
public class MyStrategy : WealthScript
{
protected override void Execute()
{
DataSeries ema = EMA.Series( Close, 30, EMACalculation.Modern );
DataSeries stoRSI = StochRSI.Series( Close, 14 );
ChartPane StochRSIPane = CreatePane( 35, true, true );
PlotSeries( StochRSIPane, stoRSI, Color.IndianRed, WealthLab.LineStyle.Solid, 1 );
// StochRSI is an "unstable" indicator so the loop should start at least 3 times its period
for(int bar = 45; bar < Bars.Count; bar++)
{
if (IsLastPositionActive)
{
Position p = LastPosition;
if( stoRSI[bar] == 100 )
SellAtMarket( bar+1, p ); else
if( p.MFEAsOfBarPercent( bar ) > 10 )
ExitAtStop( bar+1, p, p.EntryPrice, "Breakeven @ 10%" );
}
else
{
if( ( ema[bar] > ema[bar-1] ) && ( stoRSI[bar] == 0 ) )
BuyAtMarket( bar+1 );
}
}
}
}
}