declare upper;
# study("Rob Hoffman - Overlay Set", shorttitle = "RH - MAs", overlay = true)
script rma {
input source = CLOSE;
input length = 14;
def alpha = 1 / length;
def ma = alpha * source + (1 - alpha) * ma[1];
plot rma = ma;
};
def a = Average(close,3);
def b = Average(close,5);
def c = MovAvgExponential(close,18);
def d = MovAvgExponential(close,20);
def e = Average(close,50);
def f = Average(close,89);
def g = MovAvgExponential(close,144);
def h = Average(close,200);
def k = MovAvgExponential(close,35);
def tr = max(max(high - low, absValue(high - close[1])), absValue(low - close[1]));
def r = rma(tr,35);
def ku = k + r*0.5;
def kl = k - r*0.5;
plot FastSpeedLine = a;
FastSpeedLine.SetLineWeight(2);
plot SlowSpeedLine = b;
SlowSpeedLine.SetLineWeight(2);
plot FastPrimaryTrendLine = c;
FastPrimaryTrendLine.SetLineWeight(3);
plot SlowPrimaryTrendLine = d;
SlowPrimaryTrendLine.SetLineWeight(3);
plot TrendLine1 = e;
TrendLine1.SetLineWeight(3);
plot TrendLine2 = f;
TrendLine2.SetLineWeight(3);
plot TrendLine3 = g;
TrendLine3.SetLineWeight(3);
plot TrendLine4 = h;
TrendLine4.SetLineWeight(3);
plot NoTrendZoneMidline = k;
NoTrendZoneMidline.SetLineWeight(2);
plot NoTrendZoneUpperline = ku;
NoTrendZoneUpperline.SetLineWeight(2);
plot NoTrendZoneLowerline = kl;
NoTrendZoneLowerline.SetLineWeight(2);
addLabel(yes, "NoTrendZoneMidline: " + NoTrendZoneMidline + " NoTrendZoneUpperline: " + NoTrendZoneUpperline + " NoTrendZoneLowerline: " + NoTrendZoneLowerline, color.orange);