aceboogie_11
Member
I have been writing a code and I am trying to plot the mid point between two areas and was wondering how i could code for this?
This is a snippet of the code, I want to plot the midpoint between upperband4 and lowerband1
This is a snippet of the code, I want to plot the midpoint between upperband4 and lowerband1
Code:
input price = close;
input displace = 0;
input length = 20;
input Num_Dev_Dn = -1.9;
input Num_Dev_Dn1 = -2.9;
input Num_Dev_Dn2 = -3.9;
input Num_Dev_Dn3 = -4.9;
input Num_Dev_Dn4 = -5.9;
input Num_Dev_up = 1.9;
input Num_Dev_up1 = 2.9;
input Num_Dev_up2 = 3.9;
input Num_Dev_up3 = 4.9;
input Num_Dev_up4 = 5.9;
def sDev = StDev(data = price[-displace], length = length);
#DrummondChannel
def o = open(period = agg);
def h = high(period = agg);
def l = low(period = agg);
def c = close(period = agg);
def HMA = MovingAverage(AverageType.HULL, price, length)[displace];
plot Hull = HMA;
#====1-1Channel====
def y = HMA - AbsValue(h[1] - HMA);
def x = HMA + AbsValue(HMA - l[1]);
plot res = x;
plot sup = y;
plot LowerBand1 = y + Num_Dev_Dn1 * sDev;
plot UpperBand1 = x + Num_Dev_up1 * sDev;
plot LowerBand3 = y + Num_Dev_Dn3 * sDev;
plot UpperBand3 = x + Num_Dev_up3 * sDev;
plot LowerBand4 = y + Num_Dev_Dn4 * sDev;
plot UpperBand4 = x + Num_Dev_up4 * sDev;