is it possible for you to edit this script to make it be able to cloud the wicks as well?
# +------------------------------------------------------------+
# | Higher Time Frame Candles |
# | Robert Payne |
# |
https://funwiththinkscript.com |
# +------------------------------------------------------------+
def bn = BarNumber();
def lastBar = HighestAll(if !IsNaN(close) then bn else 0);
input higherTimeFrame = AggregationPeriod.HOUR;
def htf = higherTimeFrame;
def xO = open(period = htf);
def xH = high(period = htf);
def xL = low(period = htf);
def xC = close(period = htf);
def isUP = xO < xC;
def isDN = xO > xC;
def isDoji = xO == xC;
DefineGlobalColor("border up", Color.white);
DefineGlobalColor("border down", Color.DARK_RED);
DefineGlobalColor("fill up", Color.GRAY);
DefineGlobalColor("fill down", Color.PINK);
def newCandle = xO <> xO[1] and xH <> xH[1] and xL <> xL[1] and xC <> xC[1];
def osc = CompoundValue(1, if newCandle then osc[1] * -1 else osc[1], 1);
def o1 = if osc > 0 and bn <= lastBar then xO else Double.NaN;
def c1 = if osc > 0 and bn <= lastBar then xC else Double.NaN;
def o2 = if osc < 0 and bn <= lastBar then xO else Double.NaN;
def c2 = if osc < 0 and bn <= lastBar then xC else Double.NaN;
def x = if IsNaN(o1) then 0 else 1;
def start = (bn == 1 or x <> x[1]) and bn <= lastBar;
def end = bn == lastBar or start[-1];
AddCloud(o1, c1, GlobalColor("fill down"), GlobalColor("fill up"));
AddCloud(o2, c2, GlobalColor("fill down"), GlobalColor("fill up"));
plot candleOpen = if start or end or IsNaN(close) then Double.NaN else xO;
candleOpen.SetPaintingStrategy(12);
candleOpen.AssignValueColor(if xO < xC then GlobalColor("border up") else GlobalColor("border down"));
plot candleClose = if start or end or IsNaN(close) then Double.NaN else xC;
candleClose.SetPaintingStrategy(12);
candleClose.AssignValueColor(if xO < xC then GlobalColor("border up") else GlobalColor("border down"));
def osr = CompoundValue(1, osr[1] + 2, bn - lastBar);
def cnt = if start then 1 else cnt[1] + 1;
def n = htf / GetAggregationPeriod();
def mid = if end then Round(cnt / 2, 0) else 2;
def getMid = fold i = 0 to n with a = 0 while a == 0 do if GetValue(end, -i) == 1 then GetValue(mid, -i) else 0;
input showWicks = yes;
def wick = showWicks and cnt == getMid;
#up candles
def uOt = if isUP and end then xC else Double.NaN;
def uOb = if isUP and end then xO else Double.NaN;
def uHs = if isUP and start then xC else if isUP and wick then xH else Double.NaN;
def uHe = if isUP and end then xC else if isUP and wick then Min(xO, xC) else Double.NaN;
def uLs = if isUP and start then xO else if isUP and wick then Max(xO, xC) else Double.NaN;
def uLe = if isUP and end then xO else if isUP and wick then xL else Double.NaN;
def uCt = if isUP and start then xC else Double.NaN;
def uCb = if isUP and start then xO else Double.NaN;
AddChart(uHs, uLs, uOt, uCt, ChartType.BAR, GlobalColor("border up"));
AddChart(uHs, uLs, uOb, uCb, ChartType.BAR, GlobalColor("border up"));
AddChart(uHe, uLe, uOb, uCb, ChartType.BAR, GlobalColor("border up"));
AddChart(uHe, uLe, uOb, uCb, ChartType.BAR, GlobalColor("border up"));
#down candles
def dOt = if isDN and end then xC else Double.NaN;
def dOb = if isDN and end then xO else Double.NaN;
def dHs = if isDN and start then xC else if isDN and wick then xH else Double.NaN;
def dHe = if isDN and end then xC else if isDN and wick then Min(xO, xC) else Double.NaN;
def dLs = if isDN and start then xO else if isDN and wick then Max(xO, xC) else Double.NaN;
def dLe = if isDN and end then xO else if isDN and wick then xL else Double.NaN;
def dCt = if isDN and start then xC else Double.NaN;
def dCb = if isDN and start then xO else Double.NaN;
AddChart(dHs, dLs, dOt, dCt, ChartType.BAR, GlobalColor("border down"));
AddChart(dHs, dLs, dOb, dCb, ChartType.BAR, GlobalColor("border down"));
AddChart(dHe, dLe, dOb, dCb, ChartType.BAR, GlobalColor("border down"));
AddChart(dHe, dLe, dOb, dCb, ChartType.BAR, GlobalColor("border down"));
plot upperDot = if wick then xH else Double.NaN;
upperDot.SetPaintingStrategy(PaintingStrategy.POINTS);
upperDot.AssignValueColor(if isUP then GlobalColor("border up") else GlobalColor("border down"));
upperDot.SetLineWeight(2);
plot lowerDot = if wick then xL else Double.NaN;
lowerDot.SetPaintingStrategy(PaintingStrategy.POINTS);
lowerDot.AssignValueColor(if isUP then GlobalColor("border up") else GlobalColor("border down"));
lowerDot.SetLineWeight(2);
#Display Chart Time Frame
input showLabels = yes;
DefineGlobalColor("label color", CreateColor(35, 102, 160));
def nMinutes = GetAggregationPeriod() / 60000;
def Monthly = nMinutes == 43200;
def Weekly = nMinutes == 10080;
def Daily = nMinutes == 1440;
def Intraday = nMinutes < 1440 and nMinutes >= 1;
def nMinutes2 = htf / 60000;
def Monthly2 = nMinutes2 == 43200;
def Weekly2 = nMinutes2 == 10080;
def Daily2 = nMinutes2 == 1440;
def Intraday2 = nMinutes2 < 1440 and nMinutes2 >= 1;
AddLabel(showLabels, GetSymbol(), GlobalColor("label color" ));
AddLabel(showLabels and Monthly, "Monthly", GlobalColor("label color" ));
AddLabel(showLabels and Weekly, "Weekly", GlobalColor("label color" ));
AddLabel(showLabels and Daily, "Daily", GlobalColor("label color" ));
AddLabel(showLabels and Intraday, nMinutes + " Minute", GlobalColor("label color" ));
AddLabel(showLabels, "with", GlobalColor("label color"));
AddLabel(showLabels and Monthly2, "Monthly", GlobalColor("label color" ));
AddLabel(showLabels and Weekly2, "Weekly", GlobalColor("label color" ));
AddLabel(showLabels and Daily2, "Daily", GlobalColor("label color" ));
AddLabel(showLabels and Intraday2, nMinutes2 + " Minute", GlobalColor("label color" ));
AddLabel(showLabels, "overlay", GlobalColor("label color"));