ICT Clean Midnight [dR-Algo]
// This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) https://creativecommons.org/licenses/by-nc-sa/4.0/
// © dR-Algo


//@version=5
indicator('ICT Clean Midnight [dR-Algo]', shorttitle='Midnight [dR]', overlay=true)

//
// *** Input ***
//


var visualGroup = "Visual Settings"
var color defBlueColor = #2861ff2a
visualColor = input.color(defval = defBlueColor, title = "Color", group = visualGroup)
visualLineStyle = input.string(defval = "solid", title = "Line Style", options=["solid", "dotted", "dashed"], group = visualGroup)
visualShowLabel = input.bool(defval = false, title = "Show Labels", tooltip = "Show Labels")

 
visualLineStyleOption = switch visualLineStyle
    "solid"     => line.style_solid
    "dotted"    => line.style_dotted
    "dashed"    => line.style_dashed




//
// *** Draw on Chart ***
//

// Midnight

// hour = 23 => Midnight
if hour(time) == 23 and hour(time[1]) != 23
    line.new(x1=bar_index, y1=low, x2=bar_index, y2=high, color=visualColor, width=1, extend=extend.both, style = visualLineStyleOption)

