// RSI and HHV(RSI) example
// by prouser
SetChartOptions( 0, chartShowArrows | chartShowDates | chartWrapTitle, gridFlags = 0, ymax = 0, xmax = 0, blankmargin = 0 );
periods = Param( "RSI Periods", 15, 1, 200, 1 );
HHVperiods = Param( "HHV Periods", 20, 1, 200, 1 );
RSIcolor = ParamColor( "RSI Color", colorCycle );
myRSI = RSI( periods );
HHV_RSI = HHV( myRSI, HHVperiods );
GraphLabelDecimals = 2;
Plot( myRSI, "RSI", RSIcolor, ParamStyle( "RSI Style" ) | styleNoTitle, Null, Null, 0, 1 );
Plot( HHV_RSI, "HHV RSI", colorDarkGreen, ParamStyle( "HHV Style" ) | styleNoTitle, Null, Null, 0, 1 );
PlotGrid( 30, colorBrightGreen, pattern = 0, width = 2, label = True );
PlotGrid( 50, colorGrey50, pattern, width, label );
PlotGrid( 70, colorRed, pattern, width, label );
_N( Title = StrFormat( "{{NAME}} - {{INTERVAL}} - " +
EncodeColor( RSIcolor ) + "RSI(%g): %g " +
EncodeColor( colorDarkGreen ) + "HHV(RSI(%g), %g): %g " +
EncodeColor( -1 ) + "{{VALUES}}",
periods, myRSI, periods, hhvperiods, HHV_RSI ) );
|