[LegacyColorValue = true]; 

{ TSMStochasticRSI function for the Stochastic RSI
  Copyright 1999, P.J.Kaufman. All rights reserved.
 }
  inputs: price(numericseries), stochlen(numericsimple),RSIlen(numericsimple);
  vars: top(0),bottom(0);

  top = highest(RSI(price,RSIlen),Stochlen);
  bottom = lowest(RSI(price,RSIlen),Stochlen);
  TSMStochasticRSI = 0;
  if top <> bottom then 
	TSMStochasticRSI = (RSI(price,RSIlen) - bottom) / (top - bottom);
