Sie sind auf Seite 1von 2

// Downloaded From www.WiseStockTrader.

com
// RSIS Overbought/Oversold Indicator
// Version 1.0
// Last modified: 26-01-2002 by Thomas Zmuck

// Adjustment-Part - (could be parametrized)


rsiPeriod = 5; // Param("RSI period", 5, 3, 15, 1);
emaPeriod = 2; // Param("EMA period", 2, 2, 10, 1);
tp = 3; // Param("Trend period", 3, 2, 10, 1);
A = 2.5; // Param("A value", 2.5, 1.5, 5, 0.5);

// Formula
P = RSI( rsiPeriod );
y = Sum( Cum( 1 ), tp );
y1 = ( tp * Sum( Cum( 1 ) * P, tp ) - Sum( Cum( 1 ), tp ) * Sum( P, tp ) ) /
( tp * Sum( ( Cum( 1 ) * Cum( 1 ) ), tp ) - ( y * y ) ) * Cum( 1 ) +
( MA( P, tp ) -
MA( Cum( 1 ), tp ) * ( tp * Sum( Cum( 1 ) * P, tp ) - Sum( Cum( 1 ), tp )
* Sum( P, tp ) ) /
( tp * Sum( ( Cum( 1 ) * Cum( 1 ) ), tp ) - ( y * y ) ) );

slope = LinRegSlope( P, tp );
y2 = IIf( slope > 0 AND y1 > HHV( P, 3 ), HHV( P, 3 ),
IIf( slope < 0 AND y1 < LLV( P, 3 ), LLV( P, 3 ), y1 ) );
y3 = EMA( y2, emaPeriod );

e1 = EMA( P, emaPeriod + 1 );
e2 = EMA( e1, emaPeriod + 1 );
e3 = EMA( e2, emaPeriod + 1 );
e4 = EMA( e3, emaPeriod + 1 );
e5 = EMA( e4, emaPeriod + 1 );
e6 = EMA( e5, emaPeriod + 1 );

c1 = -A * A * A;
c2 = 3 * A * A + 3 * A * A * A;
c3 = -6 * A * A - 3 * A - 3 * A * A * A;
c4 = 1 + 3 * A + A * A * A + 3 * A * A;
t3 = c1 * e6 + c2 * e5 + c3 * e4 + c4 * e3;

RSIS = ( y3 + t3 ) / 2;
// End Formula

// Graph-Part
Plot( RSIS, "RSIS", colorOrange, styleLine);
// End Graph-Part

// Buy Conditions
// not used, only for testing systems
Cond1 = Ref( RSIS, -1 ) < 20;
Cond2 = Ref( RSIS, -2 ) < 20;
Cond3 = Ref( RSIS, -1 ) < Ref( RSIS, -2 );
Cond4 = Ref( RSIS, -2 ) < Ref( RSIS, -3 );
Cond5 = RSIS > Ref( RSIS, -1 );
Cond6 = (CCI( 30 ) < 100) AND (CCI( 30 ) > -100);

// Buy and Sell Conditions


Buy = Ref( rsis, -1 ) < 50 AND RSIs > Ref( RSIs, -1 );
Sell = Ref( rsis, -1 ) > 70 AND RSIs < Ref( RSIs, -1 );

Buy = ExRem( Buy, Sell );


Sell = ExRem( Sell, Buy );
// End Buy and Sell Conditions

// Title-Part
Title = Name()
+ " RSIS period = "
+ WriteVal( rsiPeriod, 1 )
+ " EMA period = " + WriteVal(emaPeriod, 1 )
+ " TP = " + WriteVal( tp, 1.1 )
+ " A = " + WriteVal( A, 1.1 );
// End Title-Part

// Added part by @Chaser2009


/*
bNumberofbars = BarsSince( Sell ) ;
bCloseOnSell = ValueWhen( Sell , Close );
bPercentChange = ( Close - bCloseOnSell ) / bCloseOnSell * 100;

snumberofbars = BarsSince( Buy ) ;


sCloseOnBuy = ValueWhen( Buy , Close );
sPercentChange = ( Close - sCloseOnBuy ) / sCloseOnBuy * 100;
*/
///////////////////////////////////////////////////////////////////////////////////
//////////
// Colorb = IIf( RSIS > Ref( RSIS, -1 ), colorBlue, colorRed );
// Colorbs = IIf( Buy, colorBlue, IIf( Sell, colorRed, colorDefault ) );
// AddColumn( sNumberOfBars, "Dn" , 1.0, colorRed, colorDefault, 60 );
Filter = 1;
AddColumn(C, "Close", 1.2);
AddColumn(Nz(y), "y", 1.5);
AddColumn(Nz(y1), "y1", 1.5);
AddColumn(Nz(y2), "y2", 1.5);
AddColumn(Nz(y3), "y3", 1.5);
AddColumn(Nz(t3), "t3", 1.5);
AddColumn(Nz(RSIS), "RSIS", 3.5);
// AddColumn( bNumberOfBars, "Up", 1.0, colorBlue, colorDefault , 60 );
DB = RSIS - Ref( RSIS, -1 );
AddColumn( DB, "Ch", 1-0, IIf( DB >= 0, colorBrightGreen, colorOrange ), colorBlack
, 60 );

Das könnte Ihnen auch gefallen