sorry about that, i'll simplify it...
i ended up finding one i made and and added the cloud.
with this one , just pick a time period, that corresponds with the desired orb time. default is 15 minutes
draws dots during orb time, at highest and lowest.
draws lines after orb time, at highest and lowest orb levels.
with after hours off, the cloud was stretching from the last bar of a day to the first bar of next day.
an easy way to stop this was to, don't draw a cloud on the first bar of the day.
Code:
# orb_07
#----------------------
# orb lines , cloud
# halcyonguy
# 23-02-26
#----------------------
def na = Double.NaN;
def bn = barnumber();
def lastbar = !isnan(close[0]) and isnan(close[-1]);
# chart time
def chartagg = GetAggregationPeriod();
def chartmin = (chartagg /(1000*60));
# pick a time for ORB
input orb_time = AggregationPeriod.fifteen_min;
def orbmin = (orb_time/(60*1000));
# daytime (EST)
input start = 0930;
input end = 1600;
def daytime = if secondsfromTime(start) >= 0 and secondstillTime(end) > 0 then 1 else 0;
def day_start = secondsfromTime(start) == 0;
input show_ORB_label = yes;
addlabel(show_ORB_label, " ORB " + orbmin, color.cyan);
def duration_sec = orbmin * 60;
def seconds_passed = secondsfromTime(start);
def isorb = if seconds_passed >= 0 and seconds_passed < duration_sec then 1 else 0;
def orbhi = high(period = orb_time);
def orblo = low(period = orb_time);
def perhigh = if !daytime then na else if isorb then orbhi else perhigh[1];
def perlow = if !daytime then na else if isorb then orblo else perlow[1];
input show_orb_level_lines = yes;
# plot dots for first bar timeframe
plot hidots = if show_orb_level_lines and isorb then perhigh else na;
plot lodots = if show_orb_level_lines and isorb then perlow else na;
hidots.setpaintingStrategy(paintingStrategy.points);
lodots.setpaintingStrategy(paintingStrategy.pointS);
hidots.setDefaultColor(color.yellow);
lodots.setDefaultColor(color.yellow);
# plot line after first bar
plot hiline = if show_orb_level_lines and !isorb then perhigh else na;
plot loline = if show_orb_level_lines and !isorb then perlow else na;
hiline.setpaintingStrategy(paintingStrategy.line);
loline.setpaintingStrategy(paintingStrategy.line);
hiline.setDefaultColor(color.yellow);
loline.setDefaultColor(color.yellow);
input show_orb_cloud = yes;
def cld_hi = if !show_orb_cloud or day_start then na else perhigh;
def cld_lo = if !show_orb_cloud or day_start then na else perlow;
addcloud(cld_hi, cld_lo, color.gray, color.gray);
#
1 minute chart
5 minute ORB time
View attachment 17803