Litecoin Halving Events
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © dogebrother

//@version=4
study(title="Litecoin Halving Events", shorttitle="Litecoin Halvings", overlay=true)

isDate(y, m, d) =>
    val = timestamp(y,m,d)
    if val <= time and val > time[1]
        true
    else 
        false

// First Halving
if isDate(2015, 8, 25)
    line.new(bar_index, low, bar_index, high, xloc.bar_index, extend.both, color=color.orange)
    label.new(bar_index, low, text="Litecoin 1st Halving - Aug 25, 2015", style=label.style_label_upper_left, textcolor=color.black, color=color.orange, textalign=text.align_right)
    
// Second Halving
if isDate(2019, 8, 5)
    line.new(bar_index, low, bar_index, high, xloc.bar_index, extend.both, color=color.orange)
    label.new(bar_index, low, text="Litecoin 2nd Halving - Aug 5, 2019", style=label.style_label_upper_left, textcolor=color.black, color=color.orange, textalign=text.align_right)
    
// Third Halving (Estimated)
if isDate(2023, 8, 5)
    line.new(bar_index, low, bar_index, high, xloc.bar_index, extend.both, color=color.orange)
    label.new(bar_index, low, text="Litecoin 3rd Halving - Aug 5, 2023", style=label.style_label_upper_left, textcolor=color.black, color=color.orange, textalign=text.align_right)    
    
// Fourth Halving (Estimated)
if isDate(2027, 8, 5)
    line.new(bar_index, low, bar_index, high, xloc.bar_index, extend.both, color=color.orange)
    label.new(bar_index, low, text="Litecoin 4th Halving - (approx) Aug 5, 2027", style=label.style_label_upper_left, textcolor=color.black, color=color.orange, textalign=text.align_right)        

