K

#### kelvin

##### New member

**Warehouse**

I saw this indicator somewhere else, it looks great with K bars and Histogram could show you very clear entry and exit points.

it comes with over bought and over sold level.

Code:

```
{ Quantitative Qualitative Estimation Indicator Revised}
inputs:
double RSIPrice( Close )[DisplayName = "RSIPrice", ToolTip =
"Price to be used in the calculation of the RSI."],
int RSILength( 14 )[DisplayName = "RSILength", ToolTip =
"The number of bars to be used in the calculation of the RSI."],
int RSISmoothLength( 5 )[DisplayName = "RSISmoothLength", ToolTip =
"The length of the exponential moving average of the RSI. This value determines the smoothing factor used in the exponential moving average calculation."],
int ATRLength( 27 )[DisplayName = "ATRLength", ToolTip =
"The length of the exponential moving average of the true range of the smoothed RSI."],
int ATRSmoothLength( 27 )[DisplayName = "ATRSmoothLength", ToolTip =
"The length of the exponential moving average of the moving average of the true range of the smoothed RSI."],
double FastATRMult( 2.618 )[DisplayName = "FastATRMult", ToolTip =
"Fast trendline scaling factor that is multiplied by the moving average of the moving average of the true range of the smooth RSI."],
double SlowATRMult( 4.236 )[DisplayName = "SlowATRMult", ToolTip =
"Slow trendline scaling factor that is multiplied by the moving average of the moving average of the true range of the smooth RSI."],
double SmoothRSIAlertLevel( 50 )[DisplayName = "SmoothRSIAlertLevel", ToolTip =
"If alerts are enabled for the indicator, an alert will be triggered if the smoothed RSI crosses the level specified by this input"],
LRSLength(3),
Multiple(2.38),
OverBought1(60),
OverBought2(70),
OverSold1(40),
OverSold2(30),
HUpColor(green),
HDwnColor(magenta),
LUpColor(Cyan),
LDwnColor(Red),
MUpColor(Green),
MDwnColor(Red),
BarUpColor(green),
BarDwColor(red),
SpreadUpColor(green),
SpreadDnColor(red);
variables:
double RetVal( 0 ),
double oSmoothRSI( 0 ),
double oFastTL( 50 ),
double oSlowTL( 50 ),
intrabarpersist bool OkToPlot( false ),
LRS(0);
RetVal = QQE( RSIPrice, RSILength, RSISmoothLength, ATRLength, ATRSmoothLength,
FastATRMult, SlowATRMult, oSmoothRSI, oFastTL, oSlowTL );
Value1 = Highest(oSmoothRSI, 2);
Value2 = Lowest(oSmoothRSI, 2);
if oSmoothRSI > oSmoothRSI[1] then
Value3 = Value1 - Value2 ;
if oSmoothRSI < oSmoothRSI[1] Then
Value3 = Value2 - Value1 ;
LRS = LinearRegSlope(oSmoothRSI, LRSLength);
{ do not plot until all exponential moving averages have stabilized }
once ( CurrentBar > 4 * MaxList( RSILength, RSISmoothLength, ATRLength,
ATRSmoothLength ) )
begin
OkToPlot = true;
end;
if OkToPlot then
begin
Plot1( oSmoothRSI, !( "SmoothRSI" ) );
Plot2( oFastTL, !( "FastTL" ) );
Plot3( oSlowTL, !( "SlowTL" ) );
Plot4( SmoothRSIAlertLevel, !( "SmRSIAlrtLev" ) );
Plot5(OverBought1, "OverBought1");
Plot6(OverSold1, "OverSold1");
Plot7(Value1, "BH");
Plot8(Value2, "BL");
Plot9(OverBought2, "OverBought2");
Plot10(OverSold2, "OverSold2");
Plot11(Value3 * Multiple , "Spread");
Plot12(LRS * Multiple, "LRS-SRSI");
var: var1(yellow), var4(yellow), var7(yellow), var8(yellow), var11(yellow);
If currentbar >= 0 then begin
If oSmoothRSI >= SmoothRSIAlertLevel then begin
if oSmoothRSI > oFastTL then var1 = HUpColor;
if oSmoothRSI < oFastTL then var1 = HDwnColor;
end;
If oSmoothRSI < SmoothRSIAlertLevel then begin
if oSmoothRSI > oFastTL then var1 = LUpColor;
if oSmoothRSI < oFastTL then var1 = LDwnColor;
end;
SetPlotColor(1,var1);
If oSmoothRSI >= SmoothRSIAlertLevel then var4 = MUpColor;
If oSmoothRSI < SmoothRSIAlertLevel then var4 = MDwnColor;
SetPlotColor(4,var4);
if oSmoothRSI > oSmoothRSI[1] then var7 = BarUpColor;
if oSmoothRSI > oSmoothRSI[1] then var8 = BarUpColor;
if oSmoothRSI < oSmoothRSI[1] then var7 = BarDwColor;
if oSmoothRSI < oSmoothRSI[1] then var8 = BarDwColor;
SetPlotColor(7,var7);
SetPlotColor(8,var8);
If Value3 >= 0 Then var11 = SpreadUpColor;
If Value3 < 0 Then var11 = SpreadDnColor;
SetPlotColor(11,var11);
End;
{ alerts }
if AlertEnabled then
begin
if oSmoothRSI crosses over SmoothRSIAlertLevel then
begin
Alert( !( "SmoothRSI crossed over" ) + " " +
NumToStr( SmoothRSIAlertLevel, 5 ) );
end
else if oSmoothRSI crosses under SmoothRSIAlertLevel then
begin
Alert( !( "SmoothRSI crossed under" ) + " " +
NumToStr( SmoothRSIAlertLevel, 5 ) );
end;
end;
end;
```

Last edited: