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

Rsi bands for Amibroker (AFL)
zritesh
almost 11 years ago
Amibroker (AFL)

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

RSI bands provide an intuitive way of visualizing how the price movement causes RSI to move with in its range (0-100). Upper/Lower bands signify overbought and oversold levels respectively (Default: 70/30). These bands closely match what Constance Brown explains in her book “Technical Analysis for the Trading Professional”.

Similar Indicators / Formulas

Febo RSI ..real indicator
Submitted by abhinavsingh about 13 years ago
Trading Volume Statistic
Submitted by tuanstock1 over 10 years ago
Ergodic Oscillator
Submitted by dljtrader about 14 years ago
3 Days Track
Submitted by janet0211 over 14 years ago
Chande Momentum Oscillator
Submitted by klimpek almost 14 years ago

Indicator / Formula

Copy & Paste Friendly
// RSI Bands use a variation of the RSI calculations to figure
// out what price level a stock should be at to be considered
// overbought/oversold.
//
// This sample code was built off the "BuiltInRSIEquivalent"
// sample RSI calculation code found on the AmiBroker website.
function BuiltInRSIEquivalent_RSI_Band_Version( period, TargetRSILevel )
{
    P = N = 0;
    result = Null;
    for( i = 1; i < BarCount; i++ )
    {
        // Standard RSI code
        diff = C[ i ] - C[ i - 1 ];
        W = S = 0;
        if( diff > 0 ) W = diff;
        if( diff < 0 ) S = -diff;
 
// Compute the hypothetical price close to reach the
// target RSI level based on yesterday's RSI and close
// Depending on whether we would need the price to
// or decrease, we use a different formula
        if(result[i-1] > C[i-1])
            HypotheticalCloseToMatchRSITarget = C[i-1]+P-P*period-((N*period)-N)
                                                *TargetRSILevel/(TargetRSILevel -100);
        else
            HypotheticalCloseToMatchRSITarget = C[i-1]-N-P+N*period+P*period+(100*P)
                                                /TargetRSILevel-(100*P*period)/TargetRSILevel ;
        // Optional clamping code
        // Uncomment this section if parameters used cause
        // too much volatility (generally caused by using a very
        // short period) This will keep the RSI Bands within
        // roughly 10% of the price
        // if( (HypotheticalCloseToMatchRSITarget - C[i]) > 0.1*C[i])
        // HypotheticalCloseToMatchRSITarget = C[i]*1.1;
        // if( (HypotheticalCloseToMatchRSITarget - C[i]) < - 0.1*C[i])
        // HypotheticalCloseToMatchRSITarget = C[i]*0.9;
        // Resume standard RSI code to update the
        // running P and N averages
        P = ( ( period -1 ) * P + W ) / period;
        N = ( ( period -1 ) * N + S ) / period;
        // Store result
        if( i >= period )
            result[ i ] = HypotheticalCloseToMatchRSITarget ;
    }
    return result;
}
Plot( BuiltInRSIEquivalent_RSI_Band_Version(14,80), "RSIB80", colorBlue );
Plot( BuiltInRSIEquivalent_RSI_Band_Version(14,20), "RSIB20", colorBlue );

//--François Bertrand

0 comments

Leave Comment

Please login here to leave a comment.

Back