The First one works and it's what I was looking for. You are all geniuses! Thank you so much.
Oh and I have added your code at the end and this is what I can share for anyone who's interested in using the $TICK chart which is very useful. Happy trading.
input ShowDistArrows = yes;
input ShowCloud = no;
input UpThreshold = 1000;
input UpThreshold2 = 700;
input DownThreshold = -1000;
input DownThreshold2 = -700;
input DistArrowLevel = 1500;
input ShowHiLo = yes;
def Above = if close > UpThreshold then 1 else 0;
def Below = if close < DownThreshold then 1 else 0;
plot pline;
plot pline2;
plot nline;
plot nline2;
pline = UpThreshold;
pline2 = UpThreshold2;
nline = DownThreshold;
nline2 = DownThreshold2;
pline.SetStyle(Curve.LONG_DASH);
pline.SetDefaultColor(Color.RED);
pline2.SetStyle(Curve.LONG_DASH);
pline2.SetDefaultColor(Color.RED);
nline.SetStyle(Curve.LONG_DASH);
nline.SetDefaultColor(Color.GREEN);
nline2.SetStyle(Curve.LONG_DASH);
nline2.SetDefaultColor(Color.GREEN);
Def cloudhigh = if ShowCloud then pline else Double.NaN;
Def cloudlow = if ShowCloud then nline else Double.NaN;
AddCloud (cloudhigh, cloudlow, Color.DARK_GRAY, Color.DARK_GRAY);
AddLabel(ShowHiLo,“HI ”+AsText(high(“$TICK”, ”Day”, ”LAST”)), Color.ORANGE);
AddLabel(ShowHiLo,“LO ”+AsText(low(“$TICK”, ”Day”, ”LAST”)), Color.ORANGE);
AddLabel(close >= 0 and close <= UpThreshold,close+ ” ”,Color.GREEN);
AddLabel(close < 0 and close >= DownThreshold,close+ ” ”,Color.RED);
AddLabel(close > UpThreshold,”[+1k] = “+ close, Color.GREEN);
AddLabel(close < DownThreshold,”[-1k] = “+close, Color.RED);
#Distribution Function
def Less = If((close < 0), 1, 0); def Greater = If((close > 0), 1, 0);
def closeByPeriod = close(period = “DAY”)[-1];
def newDay = if !IsNaN(closeByPeriod) then 0 else 1;
plot DistributionUp;
plot DistributionDown;
if !IsNaN(close(period = “DAY”)[-1])
then {
DistributionUp = Double.NaN;
DistributionDown = Double.NaN;
} else {
DistributionUp = if newDay and ShowDistArrows and Greater then +DistArrowLevel else Double.NaN;
DistributionDown = if newDay and ShowDistArrows and Less then -DistArrowLevel else Double.NaN;
}
DistributionUp.SetStyle(Curve.POINTS);
DistributionUp.SetPaintingStrategy(PaintingStrategy.LINE_VS_TRIANGLES);
DistributionUp.SetDefaultColor(Color.GREEN);
DistributionUp.SetLineWeight(3);
DistributionDown.SetStyle(Curve.POINTS);
DistributionDown.SetPaintingStrategy(PaintingStrategy.LINE_VS_TRIANGLES);
DistributionDown.SetDefaultColor(Color.RED);
DistributionDown.SetLineWeight(3);
#ZeroLine
plot zeroline = 0;
zeroline.SetDefaultColor(Color.CYAN);
zeroline.SetStyle(Curve.LONG_DASH);
zeroline.HideTitle();
zeroline.HideBubble();
#PriceLine
Plot P = Close;
P.setdefaultColor(color.white);
Plot PC = Close;
PC.setPaintingStrategy(paintingStrategy.SQUARES);
PC.setdefaultColor(color.white);