Sebastine Gap Detector
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © sebastinecc

//@version=5
indicator("Sebastine Gap Detector", overlay=true)

var float openingPrice = na
var bool gapFilledUp = na
var bool gapFilledDown = na
var bool gapFilled = false
var float previousDayClose = na

is_new_day = ta.change(dayofweek(time)) != 0
if is_new_day
    openingPrice := open
    gapFilledUp := false
    gapFilledDown := false
    gapFilled := false
    previousDayClose := close[1]

gapUp = openingPrice > close[1]
gapDown = openingPrice < close[1]

plot(previousDayClose,"PrCl",color=color.yellow,style=plot.style_circles)
plot(openingPrice,"OpPr",color=color.yellow,style=plot.style_circles)




