StochRSI

Modified on 2015/06/22 12:43 by Eugene — Categorized as: Standard Indicators

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


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 ); } } } } }