this can display several lines,
..cyan line at (high of day + open of day)/2
..magenta line at (low of day + open of day)/2
..lime dashed line from the open of day
..gray lines at high of day and low of day
Code:
# hod_open_avg_00
#https://usethinkscript.com/threads/gains-indicators.15494/
#Gains Indicators
def na = double.nan;
def bn = barnumber();
def istoday = if GetLastDay() == GetDay() then 1 else 0;
input show_only_today = yes;
input show_lines_only_on_bars = yes;
def x = if show_only_today then istoday else 1;
def linez = if show_lines_only_on_bars then !isnan(close) else 1;
#----------------------------
def agg = AggregationPeriod.day;
def day_open = open(period = agg);
def day_high = high(period = agg);
def day_low = low(period = agg);
def day_close = close(period = agg);
def hiopn = (day_high + day_open)/2;
def loopn = (day_open + day_low)/2;
input show_open_avg_lines = yes;
plot zhiop = if show_open_avg_lines and x and linez then hiopn else na;
plot zloop = if show_open_avg_lines and x and linez then loopn else na;
zhiop.setdefaultcolor(color.cyan);
zloop.setdefaultcolor(color.magenta);
zhiop.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
zloop.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
input show_highest_lowest_lines = yes;
plot zhix = if show_highest_lowest_lines and x and linez then day_high else na;
plot zlox = if show_highest_lowest_lines and x and linez then day_low else na;
zhix.setdefaultcolor(color.light_gray);
zlox.setdefaultcolor(color.light_gray);
zhix.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
zlox.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
plot zopn = if x and linez then day_open else na;
#zopn.SetPaintingStrategy(PaintingStrategy.DASHES);
zopn.SetStyle(Curve.MEDIUM_DASH);
zopn.setdefaultcolor(color.lime);
zopn.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
#
View attachment 18699