SetChartOptions(0,0,chartGrid30| chartGrid70) ;
periods = Param( "Periods", 9, 1, 200, 1 );
Ind=RSI(9) ;
Haut=60 ;
Bas=40 ;
Result = 0;
for( i = 1; i < BarCount;
i++ )
{
prev = result[ i - 1];
result[ i ] = IIf( Ind[ i ] > Haut[ i ]
AND Ind[ i ] > Bas[ i ], 5,
IIf( Ind[ i ] < Bas[ i ], 0, prev ) );
} ;
uptrend= IIf(Result,1,0) ;
downtrend= IIf(Result,1,0) ;
Plot( 2, /* defines
the height of the ribbon in percent of pane width */"ribbon",
IIf( uptrend, colorViolet, IIf(
downtrend, colorWhite, 0 )), /* choose color */
styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );
_SECTION_END();