Why wont this script actually plot the open and close prices?

By bradchris24
As you can see on the chart, the open and close prices are not where the lines are. Please help.
Thank you

// This source code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org/MPL/2.0/
// © bradchris24

//version=4

study("Short Term Levels me", shorttitle="STL", overlay=true)
t = time("1440", "0000-0930")

dclose = security(syminfo.tickerid, "D", close[1])
dopen = security(syminfo.tickerid, "D", open)

is_first = na(t[1]) and not na(t) or t[1] < t
ending_hour = input(defval=9, title="Ending Hour", type=input.integer)
ending_minute = input(defval=30, title="Ending Minute", type=input.integer)

day_high = float(na)

if is_first and barstate.isnew and (hour < ending_hour or hour >= 16 or hour == ending_hour and minute < ending_minute)
day_high := high
else
day_high := day_high[1]

if high > day_high and ((hour < ending_hour or hour >= 16) and hour < 16 or hour == ending_hour and minute < ending_minute)
day_high := high
day_high


plot(day_high, style=plot.style_line, color=color.yellow, linewidth=1)
plot(dclose, style=plot.style_line, color=color.green, linewidth=1)
plot(dopen, style=plot.style_line, color=color.red, linewidth=1)
Technical Indicators

Disclaimer