/*_SECTION_BEGIN("RSI Divrgence Arrow mark");
SetChartOptions( 0, chartShowArrows | chartShowDates );
P = ParamField( "Price field" );
periods = Param( "Periods", 14, 1, 200, 1 );
Overbought = 70;
Oversold = 30;
Centre = 50;
Plot( Overbought, "", colorRed );
Plot( Oversold, "", colorGreen );
Plot( Centre, "", colorWhite, styleDashed );
Plot( RSIa( P, periods ), _DEFAULT_NAME(), ParamColor( "Color", colorcycle ), ParamStyle( "Style" ) );
n = Param( "% Reverse ", 14, 0, 100, 1 );
Buy = Sell = 0;
bi = BarIndex();
Var = Zig( RSI(), n );
t = Trough( RSI(), n, 1 );
p = Peak( RSI(), n, 1 );
onlywhen = Var == p;
pkPrice = SparseCompress(onlywhen, Close);
pkRsi = SparseCompress(onlywhen, p);
Sell = pkPrice > Ref(pkPrice, -1) AND pkRsi < Ref(pkRsi, -1);
Sell = SparseExpand(onlywhen, Sell);
Sy0 = SparseExpand(onlywhen, Ref(pkRsi, -1));
Sy1 = SparseExpand(onlywhen, pkRsi);
pkBi = SparseCompress(onlywhen, bi);
Sx0 = SparseExpand(onlywhen, Ref(pkBi, -1));
onlywhen = Var == t;
thPrice = SparseCompress(onlywhen, Close);
thRsi = SparseCompress(onlywhen, t);
Buy = thPrice < Ref(thPrice, -1) AND thRsi > Ref(thRsi, -1);
Buy = SparseExpand(onlywhen, Buy);
By0 = SparseExpand(onlywhen, Ref(thRsi, -1));
By1 = SparseExpand(onlywhen, thRsi);
thBi = SparseCompress(onlywhen, bi);
Bx0 = SparseExpand(onlywhen, Ref(thBi, -1));
PlotShapes( IIf( Sell, shapeDownArrow, shapeNone ), colorRed, 0 , Var, Offset = -20 );
PlotShapes( IIf( Buy, shapeUpArrow, shapeNone ), colorBrightGreen, 0, Var, Offset = -20 );
// Plot the Lines
FirstVisibleBar = Status( "FirstVisibleBar" );
Lastvisiblebar = Status( "LastVisibleBar" );
for ( b = Firstvisiblebar; b <= Lastvisiblebar AND b < BarCount; b++ )
{
if ( Buy
)
Plot( LineArray( Bx0, By0, b, By1 ), "", colorRed, styleThick );
else if ( Sell )
Plot( LineArray( Sx0, Sy0, b, Sy1 ), "", colorBlue, styleThick );
}
_SECTION_END();*/