Declare lower;
def n1 = 10;
def n2 = 21;
input averageType = AverageType.EXPONENTIAL;
def ap = hlc3;
def esa = MovingAverage(averageType, ap, n1);
def d = MovingAverage(averageType, AbsValue(ap - esa), n1);
def ci = (ap - esa) / (0.015 * d);
def tci = MovingAverage(averageType, ci, n2);
def wt1 = tci;
def wt2 = MovingAverage(averageType, wt1, 4);
plot Line_0 = 0;
plot obLevel1 = 60;
plot obLevel2 = 53;
plot osLevel1 = -60;
plot osLevel2 = - 53;
plot Line_wt1 = wt1;
Line_wt1.AssignValueColor(if Line_wt1 > Line_wt1[1] then Color.cyan else Color.RED);
plot Line_wt2 = wt2;
Line_wt2.AssignValueColor(if Line_wt2 > Line_wt2[1] then Color.cyan else Color.RED);
plot Line_WD = wt1 - wt2;
Line_WD.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Addcloud (Line_wt1, Line_wt2, color.cyan, color.red);