input baseHigh = 5974.25;
input baseLow = 5970.25;
input boxStartTime = 1900;
input boxDurationHours = 16;
input heightPerBox = 5.25;
input runFromDate = 20250101;
input runToDate = 20250101;
def allowedDate = GetYYYYMMDD() >= runFromDate and GetYYYYMMDD() <= runToDate;
def isStart = SecondsFromTime(boxStartTime) == 0;
def barsToShow = Floor(boxDurationHours * 60 / (GetAggregationPeriod() / 60000));
def startBar = if isStart then BarNumber() else startBar[1];
def within = BarNumber() >= startBar and BarNumber() <= (startBar + barsToShow) and allowedDate;
# Base Zone (Blue)
plot baseTop = if within then baseHigh else Double.NaN;
plot baseBottom = if within then baseLow else Double.NaN;
AddCloud(baseTop, baseBottom, CreateColor(0, 0, 255), CreateColor(0, 0, 255));
#--------------------------------------------------------------------
# Upper Zones
# There are 14 upper zones. Their boundaries use:
# u0 = baseHigh, u1 = baseHigh + heightPerBox, ... , u14 = baseHigh + 14*heightPerBox
def u0 = baseHigh;
def u1 = baseHigh + 1 * heightPerBox;
def u2 = baseHigh + 2 * heightPerBox;
def u3 = baseHigh + 3 * heightPerBox;
def u4 = baseHigh + 4 * heightPerBox;
def u5 = baseHigh + 5 * heightPerBox;
def u6 = baseHigh + 6 * heightPerBox;
def u7 = baseHigh + 7 * heightPerBox;
def u8 = baseHigh + 8 * heightPerBox;
def u9 = baseHigh + 9 * heightPerBox;
def u10 = baseHigh + 10 * heightPerBox;
def u11 = baseHigh + 11 * heightPerBox;
def u12 = baseHigh + 12 * heightPerBox;
def u13 = baseHigh + 13 * heightPerBox;
def u14 = baseHigh + 14 * heightPerBox;
# Each zone is drawn with its own color:
# Zones 0–1: green; zones 2–5: purple; zones 6–13: teal.
AddCloud(if within then u1 else Double.NaN, if within then u0 else Double.NaN, CreateColor(0,255,0), CreateColor(0,255,0)); # Zone 0 (green)
AddCloud(if within then u2 else Double.NaN, if within then u1 else Double.NaN, CreateColor(0,255,0), CreateColor(0,255,0)); # Zone 1 (green)
AddCloud(if within then u3 else Double.NaN, if within then u2 else Double.NaN, CreateColor(238,130,238), CreateColor(238,130,238)); # Zone 2 (purple)
AddCloud(if within then u4 else Double.NaN, if within then u3 else Double.NaN, CreateColor(238,130,238), CreateColor(238,130,238)); # Zone 3 (purple)
AddCloud(if within then u5 else Double.NaN, if within then u4 else Double.NaN, CreateColor(238,130,238), CreateColor(238,130,238)); # Zone 4 (purple)
AddCloud(if within then u6 else Double.NaN, if within then u5 else Double.NaN, CreateColor(238,130,238), CreateColor(238,130,238)); # Zone 5 (purple)
AddCloud(if within then u7 else Double.NaN, if within then u6 else Double.NaN, CreateColor(0,102,102), CreateColor(0,102,102)); # Zone 6 (teal)
AddCloud(if within then u8 else Double.NaN, if within then u7 else Double.NaN, CreateColor(0,102,102), CreateColor(0,102,102)); # Zone 7 (teal)
AddCloud(if within then u9 else Double.NaN, if within then u8 else Double.NaN, CreateColor(0,102,102), CreateColor(0,102,102)); # Zone 8 (teal)
AddCloud(if within then u10 else Double.NaN, if within then u9 else Double.NaN, CreateColor(0,102,102), CreateColor(0,102,102)); # Zone 9 (teal)
AddCloud(if within then u11 else Double.NaN, if within then u10 else Double.NaN, CreateColor(0,102,102), CreateColor(0,102,102)); # Zone 10 (teal)
AddCloud(if within then u12 else Double.NaN, if within then u11 else Double.NaN, CreateColor(0,102,102), CreateColor(0,102,102)); # Zone 11 (teal)
AddCloud(if within then u13 else Double.NaN, if within then u12 else Double.NaN, CreateColor(0,102,102), CreateColor(0,102,102)); # Zone 12 (teal)
AddCloud(if within then u14 else Double.NaN, if within then u13 else Double.NaN, CreateColor(0,102,102), CreateColor(0,102,102)); # Zone 13 (teal)
# Plot white border lines at every boundary from u0 to u14:
plot w0 = if within then u0 else Double.NaN;
plot w1 = if within then u1 else Double.NaN;
plot w2 = if within then u2 else Double.NaN;
plot w3 = if within then u3 else Double.NaN;
plot w4 = if within then u4 else Double.NaN;
plot w5 = if within then u5 else Double.NaN;
plot w6 = if within then u6 else Double.NaN;
plot w7 = if within then u7 else Double.NaN;
plot w8 = if within then u8 else Double.NaN;
plot w9 = if within then u9 else Double.NaN;
plot w10 = if within then u10 else Double.NaN;
plot w11 = if within then u11 else Double.NaN;
plot w12 = if within then u12 else Double.NaN;
plot w13 = if within then u13 else Double.NaN;
plot w14 = if within then u14 else Double.NaN;
w0.SetPaintingStrategy(PaintingStrategy.LINE);
w1.SetPaintingStrategy(PaintingStrategy.LINE);
w2.SetPaintingStrategy(PaintingStrategy.LINE);
w3.SetPaintingStrategy(PaintingStrategy.LINE);
w4.SetPaintingStrategy(PaintingStrategy.LINE);
w5.SetPaintingStrategy(PaintingStrategy.LINE);
w6.SetPaintingStrategy(PaintingStrategy.LINE);
w7.SetPaintingStrategy(PaintingStrategy.LINE);
w8.SetPaintingStrategy(PaintingStrategy.LINE);
w9.SetPaintingStrategy(PaintingStrategy.LINE);
w10.SetPaintingStrategy(PaintingStrategy.LINE);
w11.SetPaintingStrategy(PaintingStrategy.LINE);
w12.SetPaintingStrategy(PaintingStrategy.LINE);
w13.SetPaintingStrategy(PaintingStrategy.LINE);
w14.SetPaintingStrategy(PaintingStrategy.LINE);
w0.SetDefaultColor(CreateColor(255,255,255));
w1.SetDefaultColor(CreateColor(255,255,255));
w2.SetDefaultColor(CreateColor(255,255,255));
w3.SetDefaultColor(CreateColor(255,255,255));
w4.SetDefaultColor(CreateColor(255,255,255));
w5.SetDefaultColor(CreateColor(255,255,255));
w6.SetDefaultColor(CreateColor(255,255,255));
w7.SetDefaultColor(CreateColor(255,255,255));
w8.SetDefaultColor(CreateColor(255,255,255));
w9.SetDefaultColor(CreateColor(255,255,255));
w10.SetDefaultColor(CreateColor(255,255,255));
w11.SetDefaultColor(CreateColor(255,255,255));
w12.SetDefaultColor(CreateColor(255,255,255));
w13.SetDefaultColor(CreateColor(255,255,255));
w14.SetDefaultColor(CreateColor(255,255,255));
w0.SetLineWeight(1);
w1.SetLineWeight(1);
w2.SetLineWeight(1);
w3.SetLineWeight(1);
w4.SetLineWeight(1);
w5.SetLineWeight(1);
w6.SetLineWeight(1);
w7.SetLineWeight(1);
w8.SetLineWeight(1);
w9.SetLineWeight(1);
w10.SetLineWeight(1);
w11.SetLineWeight(1);
w12.SetLineWeight(1);
w13.SetLineWeight(1);
w14.SetLineWeight(1);
#--------------------------------------------------------------------
# Lower Zones
# Define lower boundaries:
def d0 = baseLow;
def d1 = baseLow - 1 * heightPerBox;
def d2 = baseLow - 2 * heightPerBox;
def d3 = baseLow - 3 * heightPerBox;
def d4 = baseLow - 4 * heightPerBox;
def d5 = baseLow - 5 * heightPerBox;
def d6 = baseLow - 6 * heightPerBox;
def d7 = baseLow - 7 * heightPerBox;
def d8 = baseLow - 8 * heightPerBox;
def d9 = baseLow - 9 * heightPerBox;
def d10 = baseLow - 10 * heightPerBox;
def d11 = baseLow - 11 * heightPerBox;
def d12 = baseLow - 12 * heightPerBox;
def d13 = baseLow - 13 * heightPerBox;
def d14 = baseLow - 14 * heightPerBox;
# Color rules for lower zones:
# Zones 0–1: red; zones 2–5: grey; zones 6–13: teal.
AddCloud(if within then d0 else Double.NaN, if within then d1 else Double.NaN, CreateColor(255,0,0), CreateColor(255,0,0)); # Zone 0 (red)
AddCloud(if within then d1 else Double.NaN, if within then d2 else Double.NaN, CreateColor(255,0,0), CreateColor(255,0,0)); # Zone 1 (red)
AddCloud(if within then d2 else Double.NaN, if within then d3 else Double.NaN, CreateColor(211,211,211), CreateColor(211,211,211)); # Zone 2 (grey)
AddCloud(if within then d3 else Double.NaN, if within then d4 else Double.NaN, CreateColor(211,211,211), CreateColor(211,211,211)); # Zone 3 (grey)
AddCloud(if within then d4 else Double.NaN, if within then d5 else Double.NaN, CreateColor(211,211,211), CreateColor(211,211,211)); # Zone 4 (grey)
AddCloud(if within then d5 else Double.NaN, if within then d6 else Double.NaN, CreateColor(211,211,211), CreateColor(211,211,211)); # Zone 5 (grey)
AddCloud(if within then d6 else Double.NaN, if within then d7 else Double.NaN, CreateColor(0,102,102), CreateColor(0,102,102)); # Zone 6 (teal)
AddCloud(if within then d7 else Double.NaN, if within then d8 else Double.NaN, CreateColor(0,102,102), CreateColor(0,102,102)); # Zone 7 (teal)
AddCloud(if within then d8 else Double.NaN, if within then d9 else Double.NaN, CreateColor(0,102,102), CreateColor(0,102,102)); # Zone 8 (teal)
AddCloud(if within then d9 else Double.NaN, if within then d10 else Double.NaN, CreateColor(0,102,102), CreateColor(0,102,102)); # Zone 9 (teal)
AddCloud(if within then d10 else Double.NaN, if within then d11 else Double.NaN, CreateColor(0,102,102), CreateColor(0,102,102)); # Zone 10 (teal)
AddCloud(if within then d11 else Double.NaN, if within then d12 else Double.NaN, CreateColor(0,102,102), CreateColor(0,102,102)); # Zone 11 (teal)
AddCloud(if within then d12 else Double.NaN, if within then d13 else Double.NaN, CreateColor(0,102,102), CreateColor(0,102,102)); # Zone 12 (teal)
AddCloud(if within then d13 else Double.NaN, if within then d14 else Double.NaN, CreateColor(0,102,102), CreateColor(0,102,102)); # Zone 13 (teal)
# Lower borders: white lines at each boundary.
plot ld0 = if within then d0 else Double.NaN;
plot ld1 = if within then d1 else Double.NaN;
plot ld2 = if within then d2 else Double.NaN;
plot ld3 = if within then d3 else Double.NaN;
plot ld4 = if within then d4 else Double.NaN;
plot ld5 = if within then d5 else Double.NaN;
plot ld6 = if within then d6 else Double.NaN;
plot ld7 = if within then d7 else Double.NaN;
plot ld8 = if within then d8 else Double.NaN;
plot ld9 = if within then d9 else Double.NaN;
plot ld10 = if within then d10 else Double.NaN;
plot ld11 = if within then d11 else Double.NaN;
plot ld12 = if within then d12 else Double.NaN;
plot ld13 = if within then d13 else Double.NaN;
plot ld14 = if within then d14 else Double.NaN;
ld0.SetPaintingStrategy(PaintingStrategy.LINE);
ld1.SetPaintingStrategy(PaintingStrategy.LINE);
ld2.SetPaintingStrategy(PaintingStrategy.LINE);
ld3.SetPaintingStrategy(PaintingStrategy.LINE);
ld4.SetPaintingStrategy(PaintingStrategy.LINE);
ld5.SetPaintingStrategy(PaintingStrategy.LINE);
ld6.SetPaintingStrategy(PaintingStrategy.LINE);
ld7.SetPaintingStrategy(PaintingStrategy.LINE);
ld8.SetPaintingStrategy(PaintingStrategy.LINE);
ld9.SetPaintingStrategy(PaintingStrategy.LINE);
ld10.SetPaintingStrategy(PaintingStrategy.LINE);
ld11.SetPaintingStrategy(PaintingStrategy.LINE);
ld12.SetPaintingStrategy(PaintingStrategy.LINE);
ld13.SetPaintingStrategy(PaintingStrategy.LINE);
ld14.SetPaintingStrategy(PaintingStrategy.LINE);
ld0.SetDefaultColor(CreateColor(255,255,255));
ld1.SetDefaultColor(CreateColor(255,255,255));
ld2.SetDefaultColor(CreateColor(255,255,255));
ld3.SetDefaultColor(CreateColor(255,255,255));
ld4.SetDefaultColor(CreateColor(255,255,255));
ld5.SetDefaultColor(CreateColor(255,255,255));
ld6.SetDefaultColor(CreateColor(255,255,255));
ld7.SetDefaultColor(CreateColor(255,255,255));
ld8.SetDefaultColor(CreateColor(255,255,255));
ld9.SetDefaultColor(CreateColor(255,255,255));
ld10.SetDefaultColor(CreateColor(255,255,255));
ld11.SetDefaultColor(CreateColor(255,255,255));
ld12.SetDefaultColor(CreateColor(255,255,255));
ld13.SetDefaultColor(CreateColor(255,255,255));
ld14.SetDefaultColor(CreateColor(255,255,255));
ld0.SetLineWeight(1);
ld1.SetLineWeight(1);
ld2.SetLineWeight(1);
ld3.SetLineWeight(1);
ld4.SetLineWeight(1);
ld5.SetLineWeight(1);
ld6.SetLineWeight(1);
ld7.SetLineWeight(1);
ld8.SetLineWeight(1);
ld9.SetLineWeight(1);
ld10.SetLineWeight(1);
ld11.SetLineWeight(1);
ld12.SetLineWeight(1);
ld13.SetLineWeight(1);
ld14.SetLineWeight(1);
This one works fine too:
input baseHigh = 5974.25;
input baseLow = 5970.25;
input boxStartTime = 1900;
input boxDurationHours = 16;
input heightPerBox = 5.25;
input runFromDate = 20250101;
input runToDate = 20250101;
def allowedDate = GetYYYYMMDD() >= runFromDate and GetYYYYMMDD() <= runToDate;
def isStart = SecondsFromTime(boxStartTime) == 0;
def barsToShow = Floor(boxDurationHours * 60 / (GetAggregationPeriod() / 60000));
def startBar = if isStart then BarNumber() else startBar[1];
def within = BarNumber() >= startBar and BarNumber() <= (startBar + barsToShow) and allowedDate;
# Base Rectangle (Blue)
plot baseTop = if within then baseHigh else Double.NaN;
plot baseBottom = if within then baseLow else Double.NaN;
AddCloud(baseTop, baseBottom, CreateColor(0, 0, 255), CreateColor(0, 0, 255));
#######################
# Rectangles Above Base
#######################
AddCloud(if within then baseHigh + heightPerBox * 1 else Double.NaN,
if within then baseHigh else Double.NaN,
CreateColor(0, 255, 0), CreateColor(0, 255, 0));
plot topEdge1 = if within then baseHigh else Double.NaN;
topEdge1.SetPaintingStrategy(PaintingStrategy.LINE);
topEdge1.SetDefaultColor(CreateColor(255, 255, 255));
topEdge1.SetLineWeight(1);
AddCloud(if within then baseHigh + heightPerBox * 2 else Double.NaN,
if within then baseHigh + heightPerBox * 1 else Double.NaN,
CreateColor(0, 255, 0), CreateColor(0, 255, 0));
plot topEdge2 = if within then baseHigh + heightPerBox * 1 else Double.NaN;
topEdge2.SetPaintingStrategy(PaintingStrategy.LINE);
topEdge2.SetDefaultColor(CreateColor(255, 255, 255));
topEdge2.SetLineWeight(1);
AddCloud(if within then baseHigh + heightPerBox * 3 else Double.NaN,
if within then baseHigh + heightPerBox * 2 else Double.NaN,
CreateColor(238, 130, 238), CreateColor(238, 130, 238));
plot topEdge3 = if within then baseHigh + heightPerBox * 2 else Double.NaN;
topEdge3.SetPaintingStrategy(PaintingStrategy.LINE);
topEdge3.SetDefaultColor(CreateColor(255, 255, 255));
topEdge3.SetLineWeight(1);
AddCloud(if within then baseHigh + heightPerBox * 4 else Double.NaN,
if within then baseHigh + heightPerBox * 3 else Double.NaN,
CreateColor(238, 130, 238), CreateColor(238, 130, 238));
plot topEdge4 = if within then baseHigh + heightPerBox * 3 else Double.NaN;
topEdge4.SetPaintingStrategy(PaintingStrategy.LINE);
topEdge4.SetDefaultColor(CreateColor(255, 255, 255));
topEdge4.SetLineWeight(1);
AddCloud(if within then baseHigh + heightPerBox * 5 else Double.NaN,
if within then baseHigh + heightPerBox * 4 else Double.NaN,
CreateColor(238, 130, 238), CreateColor(238, 130, 238));
plot topEdge5 = if within then baseHigh + heightPerBox * 4 else Double.NaN;
topEdge5.SetPaintingStrategy(PaintingStrategy.LINE);
topEdge5.SetDefaultColor(CreateColor(255, 255, 255));
topEdge5.SetLineWeight(1);
AddCloud(if within then baseHigh + heightPerBox * 6 else Double.NaN,
if within then baseHigh + heightPerBox * 5 else Double.NaN,
CreateColor(238, 130, 238), CreateColor(238, 130, 238));
plot topEdge6 = if within then baseHigh + heightPerBox * 5 else Double.NaN;
topEdge6.SetPaintingStrategy(PaintingStrategy.LINE);
topEdge6.SetDefaultColor(CreateColor(255, 255, 255));
topEdge6.SetLineWeight(1);
#############################
# Additional Rectangles Above Base (Teal)
#############################
AddCloud(if within then baseHigh + heightPerBox * 7 else Double.NaN,
if within then baseHigh + heightPerBox * 6 else Double.NaN,
CreateColor(0, 102, 102), CreateColor(0, 102, 102));
plot topEdge7 = if within then baseHigh + heightPerBox * 6 else Double.NaN;
topEdge7.SetPaintingStrategy(PaintingStrategy.LINE);
topEdge7.SetDefaultColor(CreateColor(255, 255, 255));
topEdge7.SetLineWeight(1);
AddCloud(if within then baseHigh + heightPerBox * 8 else Double.NaN,
if within then baseHigh + heightPerBox * 7 else Double.NaN,
CreateColor(0, 102, 102), CreateColor(0, 102, 102));
plot topEdge8 = if within then baseHigh + heightPerBox * 7 else Double.NaN;
topEdge8.SetPaintingStrategy(PaintingStrategy.LINE);
topEdge8.SetDefaultColor(CreateColor(255, 255, 255));
topEdge8.SetLineWeight(1);
AddCloud(if within then baseHigh + heightPerBox * 9 else Double.NaN,
if within then baseHigh + heightPerBox * 8 else Double.NaN,
CreateColor(0, 102, 102), CreateColor(0, 102, 102));
plot topEdge9 = if within then baseHigh + heightPerBox * 8 else Double.NaN;
topEdge9.SetPaintingStrategy(PaintingStrategy.LINE);
topEdge9.SetDefaultColor(CreateColor(255, 255, 255));
topEdge9.SetLineWeight(1);
AddCloud(if within then baseHigh + heightPerBox * 10 else Double.NaN,
if within then baseHigh + heightPerBox * 9 else Double.NaN,
CreateColor(0, 102, 102), CreateColor(0, 102, 102));
plot topEdge10 = if within then baseHigh + heightPerBox * 9 else Double.NaN;
topEdge10.SetPaintingStrategy(PaintingStrategy.LINE);
topEdge10.SetDefaultColor(CreateColor(255, 255, 255));
topEdge10.SetLineWeight(1);
AddCloud(if within then baseHigh + heightPerBox * 11 else Double.NaN,
if within then baseHigh + heightPerBox * 10 else Double.NaN,
CreateColor(0, 102, 102), CreateColor(0, 102, 102));
plot topEdge11 = if within then baseHigh + heightPerBox * 10 else Double.NaN;
topEdge11.SetPaintingStrategy(PaintingStrategy.LINE);
topEdge11.SetDefaultColor(CreateColor(255, 255, 255));
topEdge11.SetLineWeight(1);
AddCloud(if within then baseHigh + heightPerBox * 12 else Double.NaN,
if within then baseHigh + heightPerBox * 11 else Double.NaN,
CreateColor(0, 102, 102), CreateColor(0, 102, 102));
plot topEdge12 = if within then baseHigh + heightPerBox * 11 else Double.NaN;
topEdge12.SetPaintingStrategy(PaintingStrategy.LINE);
topEdge12.SetDefaultColor(CreateColor(255, 255, 255));
topEdge12.SetLineWeight(1);
AddCloud(if within then baseHigh + heightPerBox * 13 else Double.NaN,
if within then baseHigh + heightPerBox * 12 else Double.NaN,
CreateColor(0, 102, 102), CreateColor(0, 102, 102));
plot topEdge13 = if within then baseHigh + heightPerBox * 12 else Double.NaN;
topEdge13.SetPaintingStrategy(PaintingStrategy.LINE);
topEdge13.SetDefaultColor(CreateColor(255, 255, 255));
topEdge13.SetLineWeight(1);
AddCloud(if within then baseHigh + heightPerBox * 14 else Double.NaN,
if within then baseHigh + heightPerBox * 13 else Double.NaN,
CreateColor(0, 102, 102), CreateColor(0, 102, 102));
plot topEdge14 = if within then baseHigh + heightPerBox * 13 else Double.NaN;
topEdge14.SetPaintingStrategy(PaintingStrategy.LINE);
topEdge14.SetDefaultColor(CreateColor(255, 255, 255));
topEdge14.SetLineWeight(1);
########################
# Rectangles Below Base
########################
AddCloud(if within then baseLow else Double.NaN,
if within then baseLow - heightPerBox * 1 else Double.NaN,
CreateColor(255, 0, 0), CreateColor(255, 0, 0));
plot botEdge1 = if within then baseLow else Double.NaN;
botEdge1.SetPaintingStrategy(PaintingStrategy.LINE);
botEdge1.SetDefaultColor(CreateColor(255, 255, 255));
botEdge1.SetLineWeight(1);
AddCloud(if within then baseLow - heightPerBox * 1 else Double.NaN,
if within then baseLow - heightPerBox * 2 else Double.NaN,
CreateColor(255, 0, 0), CreateColor(255, 0, 0));
plot botEdge2 = if within then baseLow - heightPerBox * 1 else Double.NaN;
botEdge2.SetPaintingStrategy(PaintingStrategy.LINE);
botEdge2.SetDefaultColor(CreateColor(255, 255, 255));
botEdge2.SetLineWeight(1);
AddCloud(if within then baseLow - heightPerBox * 2 else Double.NaN,
if within then baseLow - heightPerBox * 3 else Double.NaN,
CreateColor(211, 211, 211), CreateColor(211, 211, 211));
plot botEdge3 = if within then baseLow - heightPerBox * 2 else Double.NaN;
botEdge3.SetPaintingStrategy(PaintingStrategy.LINE);
botEdge3.SetDefaultColor(CreateColor(255, 255, 255));
botEdge3.SetLineWeight(1);
AddCloud(if within then baseLow - heightPerBox * 3 else Double.NaN,
if within then baseLow - heightPerBox * 4 else Double.NaN,
CreateColor(211, 211, 211), CreateColor(211, 211, 211));
plot botEdge4 = if within then baseLow - heightPerBox * 3 else Double.NaN;
botEdge4.SetPaintingStrategy(PaintingStrategy.LINE);
botEdge4.SetDefaultColor(CreateColor(255, 255, 255));
botEdge4.SetLineWeight(1);
AddCloud(if within then baseLow - heightPerBox * 4 else Double.NaN,
if within then baseLow - heightPerBox * 5 else Double.NaN,
CreateColor(211, 211, 211), CreateColor(211, 211, 211));
plot botEdge5 = if within then baseLow - heightPerBox * 4 else Double.NaN;
botEdge5.SetPaintingStrategy(PaintingStrategy.LINE);
botEdge5.SetDefaultColor(CreateColor(255, 255, 255));
botEdge5.SetLineWeight(1);
AddCloud(if within then baseLow - heightPerBox * 5 else Double.NaN,
if within then baseLow - heightPerBox * 6 else Double.NaN,
CreateColor(211, 211, 211), CreateColor(211, 211, 211));
plot botEdge6 = if within then baseLow - heightPerBox * 5 else Double.NaN;
botEdge6.SetPaintingStrategy(PaintingStrategy.LINE);
botEdge6.SetDefaultColor(CreateColor(255, 255, 255));
botEdge6.SetLineWeight(1);
# Added white border for the bottom edge of the lowest grey rectangle
plot bottomBorderGrey = if within then baseLow - heightPerBox * 6 else Double.NaN;
bottomBorderGrey.SetPaintingStrategy(PaintingStrategy.LINE);
bottomBorderGrey.SetDefaultColor(CreateColor(255, 255, 255));
bottomBorderGrey.SetLineWeight(1);
#############################
# Additional Rectangles Below Base (Teal)
#############################
AddCloud(if within then baseLow - heightPerBox * 6 else Double.NaN,
if within then baseLow - heightPerBox * 7 else Double.NaN,
CreateColor(0, 102, 102), CreateColor(0, 102, 102));
plot botEdge7 = if within then baseLow - heightPerBox * 7 else Double.NaN;
botEdge7.SetPaintingStrategy(PaintingStrategy.LINE);
botEdge7.SetDefaultColor(CreateColor(255, 255, 255));
botEdge7.SetLineWeight(1);
AddCloud(if within then baseLow - heightPerBox * 7 else Double.NaN,
if within then baseLow - heightPerBox * 8 else Double.NaN,
CreateColor(0, 102, 102), CreateColor(0, 102, 102));
plot botEdge8 = if within then baseLow - heightPerBox * 8 else Double.NaN;
botEdge8.SetPaintingStrategy(PaintingStrategy.LINE);
botEdge8.SetDefaultColor(CreateColor(255, 255, 255));
botEdge8.SetLineWeight(1);
AddCloud(if within then baseLow - heightPerBox * 8 else Double.NaN,
if within then baseLow - heightPerBox * 9 else Double.NaN,
CreateColor(0, 102, 102), CreateColor(0, 102, 102));
plot botEdge9 = if within then baseLow - heightPerBox * 9 else Double.NaN;
botEdge9.SetPaintingStrategy(PaintingStrategy.LINE);
botEdge9.SetDefaultColor(CreateColor(255, 255, 255));
botEdge9.SetLineWeight(1);
AddCloud(if within then baseLow - heightPerBox * 9 else Double.NaN,
if within then baseLow - heightPerBox * 10 else Double.NaN,
CreateColor(0, 102, 102), CreateColor(0, 102, 102));
plot botEdge10 = if within then baseLow - heightPerBox * 10 else Double.NaN;
botEdge10.SetPaintingStrategy(PaintingStrategy.LINE);
botEdge10.SetDefaultColor(CreateColor(255, 255, 255));
botEdge10.SetLineWeight(1);
AddCloud(if within then baseLow - heightPerBox * 10 else Double.NaN,
if within then baseLow - heightPerBox * 11 else Double.NaN,
CreateColor(0, 102, 102), CreateColor(0, 102, 102));
plot botEdge11 = if within then baseLow - heightPerBox * 11 else Double.NaN;
botEdge11.SetPaintingStrategy(PaintingStrategy.LINE);
botEdge11.SetDefaultColor(CreateColor(255, 255, 255));
botEdge11.SetLineWeight(1);
AddCloud(if within then baseLow - heightPerBox * 11 else Double.NaN,
if within then baseLow - heightPerBox * 12 else Double.NaN,
CreateColor(0, 102, 102), CreateColor(0, 102, 102));
plot botEdge12 = if within then baseLow - heightPerBox * 12 else Double.NaN;
botEdge12.SetPaintingStrategy(PaintingStrategy.LINE);
botEdge12.SetDefaultColor(CreateColor(255, 255, 255));
botEdge12.SetLineWeight(1);
AddCloud(if within then baseLow - heightPerBox * 12 else Double.NaN,
if within then baseLow - heightPerBox * 13 else Double.NaN,
CreateColor(0, 102, 102), CreateColor(0, 102, 102));
plot botEdge13 = if within then baseLow - heightPerBox * 13 else Double.NaN;
botEdge13.SetPaintingStrategy(PaintingStrategy.LINE);
botEdge13.SetDefaultColor(CreateColor(255, 255, 255));
botEdge13.SetLineWeight(1);
AddCloud(if within then baseLow - heightPerBox * 13 else Double.NaN,
if within then baseLow - heightPerBox * 14 else Double.NaN,
CreateColor(0, 102, 102), CreateColor(0, 102, 102));
plot botEdge14 = if within then baseLow - heightPerBox * 14 else Double.NaN;
botEdge14.SetPaintingStrategy(PaintingStrategy.LINE);
botEdge14.SetDefaultColor(CreateColor(255, 255, 255));
botEdge14.SetLineWeight(1);