Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

Stochastic RSI (STOCH RSI) for eSignal (EFS)

Rating:
0 / 5 (Votes 0)
Tags:
eSignal, oscillator

The Stoch RSI indicator was developed by Tushar Chande and Stanley Kroll. It is basically an indicator of an indicator. In this case it is an indicator over the Relative Strength Index (RSI). It measures the level of the RSI indicator relative to its high-low range over a period of time.

The Stoch RSI indicator can be used to identify overbought or oversold conditions. A move above .80 is considered overbought, while a move below .20 is considered oversold. It can also be used to identify the short-term trend. Stoch RSI indicates an uptrend when it is consistently above .50 and a downtrend when it is consistently below .50. Since it is a quite volatile indicator, some smoothing with a moving average can improve its ability to identify short-term trends.

Indicator / Formula

Copy & Paste Friendly
/*********************************************************
Alexis C. Montenegro © December 2004                      
Use and/or modify this code freely. If you redistribute it
please include this and/or any other comment blocks and a 
description of any changes you make.                      
**********************************************************/

var fpArray = new Array();

function preMain() {
    setPriceStudy(false);
    setStudyTitle("Stoch RSI");
    setCursorLabelName("%K",0);
    setCursorLabelName("%D",1);
    setDefaultBarFgColor(Color.blue, 0);
    setDefaultBarFgColor(Color.red, 1);
    setDefaultBarThickness(1,0);
    setDefaultBarThickness(1,1);
    var x=0;
    fpArray[x] = new FunctionParameter("KLength", FunctionParameter.NUMBER);
	with(fpArray[x++]){
        setName("%K");
        setLowerLimit(1);		
        setDefault(14);
    }
	fpArray[x] = new FunctionParameter("KSmoothing", FunctionParameter.NUMBER);
	with(fpArray[x++]){
        setName("%KSmooth");
        setLowerLimit(1);		
        setDefault(1);
    }
    fpArray[x] = new FunctionParameter("DLength", FunctionParameter.NUMBER);
	with(fpArray[x++]){
        setName("%D");
        setLowerLimit(1);		
        setDefault(3);
    }
    fpArray[x] = new FunctionParameter("RSILength", FunctionParameter.NUMBER);
	with(fpArray[x++]){
        setLowerLimit(1);		
        setDefault(14);
    }
	fpArray[x] = new FunctionParameter("RSISource", FunctionParameter.STRING);
	with(fpArray[x++]){
        addOption("open"); 
        addOption("high");
        addOption("low");
        addOption("close");
        addOption("hl2");
        addOption("hlc3");
        addOption("ohlc4"); 
        setDefault("close"); 
    }
    fpArray[x] = new FunctionParameter("Symbol", FunctionParameter.STRING);
    with(fpArray[x++]){
        setDefault();
	}
	fpArray[x] = new FunctionParameter("Interval", FunctionParameter.STRING);
	with(fpArray[x++]){
        setDefault();
    }
    fpArray[x] = new FunctionParameter("Upper", FunctionParameter.NUMBER);
	with(fpArray[x++]){
        setLowerLimit(0);
        setDefault(80); 
    }
	fpArray[x] = new FunctionParameter("Lower", FunctionParameter.NUMBER);
	with(fpArray[x++]){
        setLowerLimit(0);
        setDefault(20); 
	}
	fpArray[x] = new FunctionParameter("LineColor1", FunctionParameter.COLOR);
	with(fpArray[x++]){
        setName("Color1");
        setDefault(Color.blue);
    }
    fpArray[x] = new FunctionParameter("LineColor2", FunctionParameter.COLOR);
	with(fpArray[x++]){
        setName("Color2");
        setDefault(Color.red);
    }
    fpArray[x] = new FunctionParameter("Params", FunctionParameter.BOOLEAN);
	with(fpArray[x++]){
        setName("Show Parameters");
        setDefault(false);
    }
}

var bInit = false;
var xStochK = null;
var xStochD = null;

function main(KLength,KSmoothing,DLength,RSILength,RSISource,Symbol,Interval,Upper,Lower,LineColor1,LineColor2,Params) {
    if(bInit == false){
        if(Symbol == null) Symbol = getSymbol();
        if(Interval == null) Interval = getInterval();
        var vSymbol = Symbol+","+Interval;
        xStochK = getSeries(stochK(KLength,KSmoothing,DLength,rsi(RSILength,eval(RSISource)(sym(vSymbol)))));
        xStochD = getSeries(stochD(KLength,KSmoothing,DLength,rsi(RSILength,eval(RSISource)(sym(vSymbol)))));   
        setDefaultBarFgColor(LineColor1,0);
        setDefaultBarFgColor(LineColor2,1);
        addBand( Upper, PS_SOLID, 1, Color.black,"Upper");
        addBand( Lower, PS_SOLID, 1, Color.black,"Lower");
        setShowTitleParameters(eval(Params));
        bInit = true;
    }
    return new Array (xStochK,xStochD);
}

0 comments

Leave Comment

Please login here to leave a comment.

Back