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 for Amibroker (AFL)

Rating:
3 / 5 (Votes 2)
Tags:
oscillator, amibroker

Stochastic RSI was developed by Tushar Chande and associates. The attached modification was created by Robert Miner based on StochRSI.

Use it as a Stochastic or to help you counting waves. Set MAType=1 if you want the simple version, or MAType=2 for exponential.

Indicator / Formula

Copy & Paste Friendly
/*
The very known indicator created by Robert Miner based on StochRSI.
Use it as a Stochastic or to help
you counting waves. Set MAType=1 if you want the simple version, or
MAType=2 for exponential.
*/
/* DT Oscillator
**
** AFL translation by X-Trader
** http://www.x-trader.net
**
*/

PeriodRSI = Param( "PeriodRSI", 13, 1, 250, 1 );
PeriodStoch = Param( "PeriodStoch", 8, 1, 250, 1 );
MAType = Param( "MAType", 1, 1, 2, 1 );
PeriodSK = Param( "PeriodSK", 5, 1, 250, 1 );
PeriodSD = Param( "PeriodSD", 3, 1, 250, 1 );
Upper = Param( "Upper", 70, 50, 100, 1 );
Lower = Param( "Lower", 30, 0, 50, 1 );

irsi = RSI( PeriodRSI );
llvRsi = LLV( irsi, PeriodStoch );
hhvRsi = HHV( irsi, PeriodStoch );

StoRSI = 100 * ((irsi- llvRsi) / Max(hhvRsi - llvRsi, 0.0001));

if( MAType == 1 )
{
    SK = MA( StoRSI, PeriodSK );
    SD = MA( SK, PeriodSD );
}

if( MAType == 2 )
{
    SK = EMA( StoRSI, PeriodSK );
    SD = EMA( SK, PeriodSD );
}

Plot( SK, "DTOscSK", ParamColor( "ColorSK", colorBlueGrey ), styleLine );
Plot( SD, "DTOscSD", ParamColor( "ColorSD", colorWhite ), styleDashed );
Plot( 0, "ZeroLine", ParamColor( "ColorZero", colorWhite ), styleLine );
Plot( Upper, "Upper", ParamColor( "ColorUpper", colorRed ), styleLine );
Plot( Lower, "Lower", ParamColor( "ColorLower", colorGreen ), styleLine );

3 comments

1. jyotirmay

error showing Division by zero divisor array[13] is equal zero

2. administrator

Try it again I have corrected the code.

3. parfumeur

See: http://www.wisestocktrader.com/indicators/1653-dtoscillator

Leave Comment

Please login here to leave a comment.

Back