SMOOTHED RSI INVERSE FISHER TRANSFORM
Calculation of Sylvain Vervoort’s smoothed Rsi inverse Fisher transform, as presented in his article in this issue, begins by smoothing the price curve with the “rainbow” weighted moving average. This smoothed price curve is used to calculate an Rsi, which is then smoothed with the Vervoort zero-lag exponential moving average. The resulting curve is then transformed with an inverse Fisher filter.
Fisher suggests that a breakout above 12 indicates buying opportunities and a breakdown below 88 indicates selling opportunities. These opportunities should then be studied in the context of a slow stochastic and Vervoort’s own Arsi indicator. Here, we present the code for Vervoort’s rainbow (the indicator code) and Rsi_InverseFisher transforms (indicator and strategy code). The “Sve_RainbowAverage” function is used in the strategy and indicators.
AMIBROKER: SMOOTHED RSI INVERSE FISHER TRANSFORM
Implementing a smoothed Rsi inverse Fisher transform as described in Sylvain Vervoort’s article in this issue is easy in AmiBroker Formula Language (Afl).
A ready-to-use formula for the article is presented in Listing 1. Note that instead of the difficult-to-read, nested code of the original article, we use iteration (a loop). This results not only in cleaner code but also allows changing the “depth” of the rainbow without the need to recode the formula. In addition to that, we are also providing an asymmetrical Rsi (Arsi) formula in Listing 2. To use it, enter the formula in the Afl editor, then press the Insert Indicator button.
LISTING 1
// TASC Oct 2010 - SVE Inv Fisher
RSIPer = Param("RSI Period", 4, 2, 30 );
EMAper = Param("EMA Period", 4, 1, 100 );
mwiter = C;
RainbW = 0;
for( i = 0; i < 10; i++ )
{
weight = Max( 5 - i, 1 );
mwiter = WMA( mwiter, 2 );
RainbW += weight * mwiter;
}
RainbW /= 20;
x = 0.1 * ( RSIa( RainbW, RSIper ) - 50 );
EMA1 = EMA( x, EMAPer );
EMA2 = EMA( EMA1, EMAPer );
Difference = EMA1 - EMA2;
Z1Ema = EMA1 + Difference;
ex = exp( 2 * Z1EMA );
y = ( ex - 1 )/( ex + 1 );
invfish = 50 * ( y + 1 );
Plot( invfish, "SVE Inverse Fisher RSI", colorRed );
LISTING 2
// ARSI formula
// variable period version
Period = Param("ARSI Period", 14, 1, 100 );
Chg = C - Ref( C, -1 );
UpCount = Sum( Chg >= 0, Period );
DnCount = Period - UpCount;
UpMove = AMA( Max( Chg, 0 ), Nz( 1/UpCount ) );
DnMove = AMA( Max( -Chg, 0 ), Nz( 1/DnCount ) );
RS = UpMove/DnMove;
ARSI = 100-(100/(1+RS));
Plot( ARSI, "ARSI_V("+Period+")", colorBlue );
nb:change parameter like arsi 8,5,12 and stoch k 50,20,12 days which is suitable for you.
I use 8 days arsi and stoch 21 day .it is working cool for me.
No comments:
Post a Comment