I have a code for a daily pivot. The line is one day. Is there any way to take that horizontal line and extend the line to end on the next day or two? Below is the code. Not sure how to get the lines to be two or three days long. If you can help, it would be greatly appreciated!!!
Code:
declare upper;
input aggregationPeriod = AggregationPeriod.day;
input plot_limit = 10;
def bar = BarNumber();
def high = high(period = aggregationPeriod);
def low = low(period = aggregationPeriod);
def CDP1 = (High + Low) / 2;
def countt = if IsNaN(CDP1) and !IsNaN(CDP1[1]) then 1 else countt[1] + 1;
def cond = CDP1;
rec dataCount = CompoundValue(1, if !IsNaN(cond) then dataCount[1] + 1 else dataCount[1], 0);
def counth = if IsNaN(CDP1) and !IsNaN(CDP1[1]) then 1 else counth[1] + 1;
plot CDP = if HighestAll(dataCount) - dataCount <= plot_limit - 1 then CDP1 else Double.NaN;
plot CDPEXTEND = if IsNaN(CDP1) then GetValue(CDP1, counth) else Double.NaN;
CDP.SetDefaultColor(Color.YELLOW);
CDP.SetLineWeight(2);
CDP.setpaintingstrategy(paintingstrategy.DASHES);
CDPEXTEND.SetDefaultColor(Color.YELLOW);
CDPEXTEND.SetLineWeight(2);
CDPEXTEND.setpaintingstrategy(paintingstrategy.DASHES);