Indicator · Pine Script v5 · On the chart

One Setup for Life ICT

by alvinng214· code credited to Giovanni-1

This indicator plots horizontal lines, boxes and text labels on the price chart to mark key trading sessions.

View on GitHub

GitHub stars2on the repository
Pine versionv5runs as is
Lines of code361
Settings26inputs
LicenceNone statedfile: MPL-2.0
Last update2 months ago5 Aug 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

361 lines of Pine Script v5 from S1_Silver_Bullet/One Setup for Life ICT.txt, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

One Setup for Life ICT.txt
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Giovanni-1-

//Credit for open source code:
//@joshuuu


//@version=5
indicator('One Setup for Life ICT' , overlay = true , precision = 0 , max_boxes_count = 500 , max_labels_count = 500 , max_lines_count = 500 , max_bars_back = 500)

max_tf   = input.int(defval = 15 , title = 'Max TF Show ' , maxval = 60 , inline = '0' , group = 'Input')
Timezone = 'America/New_York' 
DOM = (timeframe.multiplier <= max_tf) and (timeframe.isintraday)

//--------------
//---Function
//--------------
is_newbar(sess) =>
    t = time('D', sess, Timezone)
    na(t[1]) and not na(t) or t[1] < t
is_session(sess) =>
    not na(time('D', sess, Timezone))
//--------------
//---End Function
//--------------

//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
// Divider Daily and open NY
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//

//---Input
show_daily= input.bool(defval = true , title = 'Daily' , inline = 'divider' , inline = '0' , group = 'Divider')
col_D     = input.color(defval = color.new(color.gray,85) , title = '' , inline = '0' , group = 'Divider')

//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
// Silver Bullet
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//

//---Br
show_BR_Sess  = input.bool(defval = false , title = 'Session' , inline = '0'  , group = 'Background')
show_BR_SB = input.bool(defval = false , title = 'Silver Bullet' , inline = '0'  , group = 'Background')
show_BR_LN = input.bool(defval = false , title = 'LN' , inline = '1' , group = 'Background')
show_BR_NY = input.bool(defval = false , title = 'NY' , inline = '1' , group = 'Background')
show_BR_PM = input.bool(defval = false , title = 'PM' , inline = '1' , group = 'Background')

BarInSession(sess) =>
    time(timeframe.period, sess, Timezone) != 0
chartColour1 = DOM and show_BR_Sess and show_BR_LN and BarInSession('0200-0500') ? color.new(color.blue , 97) : na
bgcolor(color = chartColour1 , title = 'Session LN' , transp = 95)
chartColour2 = DOM and show_BR_Sess and show_BR_NY and BarInSession('0930-1200') ? color.new(color.red , 97) : na
bgcolor(color = chartColour2 , title = 'Session NY' , transp = 95)
chartColour3 = DOM and show_BR_Sess and show_BR_PM and BarInSession('1330-1600') ? color.new(color.purple , 97) : na
bgcolor(color = chartColour3 , title = 'Session PM' , transp = 95)
chartColour4 = DOM and show_BR_SB and show_BR_LN and BarInSession('0300-0400') ? color.new(color.blue , 90) : na
bgcolor(color = chartColour4 , title = 'Silver Bullet London' , transp = 95)
chartColour5 = DOM and show_BR_SB and show_BR_NY and BarInSession('1000-1100') ? color.new(color.red , 90) : na
bgcolor(color = chartColour5 , title = 'Silver Bullet NewYork' , transp = 95)
chartColour6 = DOM and show_BR_SB and show_BR_PM and BarInSession('1400-1500') ? color.new(color.purple , 90) : na
bgcolor(color = chartColour6 , title = 'Silver Bullet PM' , transp = 95)

//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
// One set up for life
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//

show_Sess = input.bool(defval = true , title = 'Session  ' , inline = '00'  , group = 'Session One Set Up for Life')
show_Box_Sess = input.bool(defval = true , title = 'Box  ' , inline = '00'  , group = 'Session One Set Up for Life')
show_txt_box  = input.bool(defval = true , title = 'Text Box ' , inline = '00'  , group = 'Session One Set Up for Life')

show_Prev_Lin_Sess = input.bool(defval = true , title = 'Prev. H/L ' , inline = '01' , group = 'Session One Set Up for Life')
show_txt_Lin_Sess  = input.bool(defval = false , title = 'Text '     , inline = '01' , group = 'Session One Set Up for Life')
show_price_ses     = input.bool(defval = false , title = 'Price'     , inline = '01' , group = 'Session One Set Up for Life')

Show_OND           = input.bool(defval = false  , title = 'Show Only for Today' , inline = '02'  , group = 'Session One Set Up for Life')
choise_start_OSFL  = input.string(defval = '09:30' , title = 'Start time when you take Prev.H/L' , options = ['00:00' , '02:00' , '08:30' , '09:30'] , inline = '03'  , group = 'Session One Set Up for Life')
show_line_start    = input.bool(defval = true , title = 'Line Start' , inline = '03'  , group = 'Session One Set Up for Life')
col_line_start     = input.color(defval = color.new(color.orange,60) , title =  '' , inline = '03'  , group = 'Session One Set Up for Life')

show_Sess_0 = input.bool(defval = true , title = 'London' , inline = '0'  , group = 'Session One Set Up for Life')
Sess_0      = '0200-0500'
col_Sess_0  = input.color(defval = color.blue , title = '' , inline = '1'  , group = 'Session One Set Up for Life')
txt_Sess_0  = 'London' 

show_Sess_1 = input.bool(defval = true , title = 'Prev.AM' , inline = '0'  , group = 'Session One Set Up for Life')
Sess_1      = '0930-1200'
col_Sess_1  = input.color(defval = color.red , title = '    ' , inline = '1'  , group = 'Session One Set Up for Life')
txt_Sess_1  = 'Prev.AM' 

show_Sess_2 = input.bool(defval = true , title = 'Lunch' , inline = '0'  , group = 'Session One Set Up for Life')
Sess_2      = '1200-1330'
col_Sess_2  = input.color(defval = color.yellow , title = '    ' , inline = '1'  , group = 'Session One Set Up for Life')
txt_Sess_2  = 'Lunch' 

show_Sess_3 = input.bool(defval = true , title = 'PM' , inline = '0'  , group = 'Session One Set Up for Life')
Sess_3      = '1330-1600'
col_Sess_3  = input.color(defval = color.purple , title = '   ' , inline = '1'  , group = 'Session One Set Up for Life')
txt_Sess_3  = 'PM'

time_start  = choise_start_OSFL == '00:00' ? timestamp(Timezone , year , month , dayofmonth , 0, 00 , 00) : choise_start_OSFL == '02:00' ? timestamp(Timezone , year , month , dayofmonth , 2, 00 , 00) 
          : choise_start_OSFL == '08:30' ? timestamp(Timezone , year , month , dayofmonth , 8, 30 , 00) : timestamp(Timezone , year , month , dayofmonth , 9, 30 , 00)
time_start_LN     = timestamp(Timezone , year , month , dayofmonth , 2, 00 , 00)
time_start_LC     = timestamp(Timezone , year , month , dayofmonth , 13, 30 , 00)

// Daily Dividers
//--Timing Session
is_new_session     = time(timeframe.period , '0000-0001', Timezone)
is_new_session_AS  = time(timeframe.period , '0000-0001' , Timezone)
is_sess_start_LN_0 = time(timeframe.period , '0200-0201' , Timezone)
 
is_new_session_LN  = time(timeframe.period , '0500-0501' , Timezone)
//is_new_session_LN  = time(timeframe.period , '0930-0931' , Timezone)
is_new_session_NY  = time(timeframe.period , '1200-1201' , Timezone)
is_new_session_LC  = time(timeframe.period , '1330-1331' , Timezone)
is_sess_start_PM_0 = time(timeframe.period , '1600-1601' , Timezone)
is_new_session_PM  = time(timeframe.period , '1800-1801' , Timezone)

is_line_start  = choise_start_OSFL == '02:00' ? time(timeframe.period, '0200-0201', Timezone) : choise_start_OSFL == '08:30' ? time(timeframe.period, '0830-0831', Timezone) : time(timeframe.period, '0930-0931', Timezone)

var line D_open = na
var line Ny_open = na
if is_new_session and show_daily and DOM
    D_open := line.new(bar_index , bar_index , bar_index , bar_index + 1 , extend = extend.both , color = col_D , style = line.style_solid)
if is_line_start and show_line_start and DOM
    Ny_open := line.new(bar_index , bar_index , bar_index , bar_index + 1 , extend = extend.both , color = col_line_start , style = line.style_dotted)

//--------------
//---Text Box
//--------------
if DOM and show_Sess  
    var float top_bottom = 0
    var color kz_color = na
    var bool in_kz     = na
    var string kz_text = na
    if show_txt_box
        if show_Sess_0 and time(timeframe.period, Sess_0 , Timezone)
            in_kz := true
            kz_color := color.new(col_Sess_0 , 80)
            kz_text := txt_Sess_0 
        else if show_Sess_1 and time(timeframe.period, Sess_1 , Timezone)
            in_kz := true
            kz_color := color.new(col_Sess_1 , 80)
            kz_text := txt_Sess_1 
        else if show_Sess_2 and time(timeframe.period, '1201-1330' , Timezone)
            in_kz := true
            kz_color := color.new(col_Sess_2 , 80)
            kz_text := txt_Sess_2
        else if show_Sess_3 and time(timeframe.period, '1331-1600' , Timezone)
            in_kz := true
            kz_color := color.new(col_Sess_3 , 80)
            kz_text := txt_Sess_3   
        else
            in_kz := false
    else
        in_kz := true

    var box kz_box = na
    var line kz_start_line = na
    var line kz_end_line = na
    if show_txt_box
        if in_kz and not in_kz[1]
            kz_box := box.new(bar_index, high, bar_index, low, border_color = color.new(color.red, 100), bgcolor = kz_color, text = kz_text , text_size = size.small)
            kz_start_line := line.new(bar_index, high, bar_index, box.get_top(kz_box), color = kz_color, style = line.style_dotted)
            top_bottom := 0
        if in_kz[1]
            box.set_right(kz_box, bar_index)
            if high>box.get_bottom(kz_box)
                box.set_bottom(kz_box,1.0010* high)
                box.set_top(kz_box,1.0015*high)
                line.set_y2(kz_start_line, box.get_top(kz_box))
        if in_kz[1] and not in_kz
            kz_end_line := line.new(bar_index, high, bar_index, box.get_top(kz_box), color = kz_color, style = line.style_dotted)
 
//--------------
//---High Low Prev Session
//--------------

if DOM and show_Sess and show_Sess_0
    var box box_sess_0 = na
    if is_newbar(Sess_0) 
        box_sess_0 := box.new(bar_index, high, bar_index, low , border_color = color.new(#c78234, 100) , bgcolor = show_Box_Sess ? color.new(col_Sess_0 , 90) : na)
        if Show_OND  
            box.delete(box_sess_0[1]) 
    else if is_session(Sess_0) 
        box.set_right(box_sess_0, bar_index+1)           
        if high > box.get_top(box_sess_0)
            box.set_top(box_sess_0, high)
        if low < box.get_bottom(box_sess_0)
            box.set_bottom(box_sess_0, low) 
 
    var bool can_draw_high_sess_0 = false
    var bool can_draw_low_sess_0 = false
    var line high_sess_0 = na 
    var line low_sess_0 = na
    var label LBhigh_sess_0 = na
    var label LBlow_sess_0 = na
    if (is_new_session_LN) and show_Sess_0 and show_Prev_Lin_Sess
        can_draw_high_sess_0 := true   
        can_draw_low_sess_0  := true    
        high_sess_0 := line.new(bar_index, box.get_top(box_sess_0), bar_index, box.get_top(box_sess_0), color = col_Sess_0)    // Get new line id
        low_sess_0  := line.new(bar_index, box.get_bottom(box_sess_0), bar_index, box.get_bottom(box_sess_0), color = col_Sess_0)
        if Show_OND
            line.delete(high_sess_0[1])
            line.delete(low_sess_0[1])
        if show_txt_Lin_Sess
            LBhigh_sess_0 := label.new(x = last_bar_index , y = box.get_top(box_sess_0)    , text = show_price_ses ? txt_Sess_0 +' High '+ str.tostring(box.get_top(box_sess_0)) : txt_Sess_0 +' High ', xloc = xloc.bar_index , yloc = yloc.price , color = na , style = label.style_label_down, textcolor = col_Sess_0 , textalign = text.align_right , tooltip = 'Prev.PM High' )
            LBlow_sess_0  := label.new(x = last_bar_index , y = box.get_bottom(box_sess_0) , text = show_price_ses ? txt_Sess_0 +' Low ' +str.tostring(box.get_bottom(box_sess_0)): txt_Sess_0 +' Low ', xloc = xloc.bar_index , yloc = yloc.price , color = na , style =  label.style_label_center, textcolor = col_Sess_0 , textalign = text.align_right , tooltip = 'Prev.PM Low')
            label.delete(LBhigh_sess_0[1]) 
            label.delete(LBlow_sess_0[1])   
    else
        if (can_draw_high_sess_0)
            if (time > (time_start_LN + 0 * 1000*60) and high > line.get_y1(high_sess_0))
                can_draw_high_sess_0 := false  
                label.delete(LBhigh_sess_0[0])
            else
                line.set_x2(high_sess_0, bar_index)
        if (can_draw_low_sess_0)
            if (time > (time_start_LN + 0 * 1000*60) and low < line.get_y1(low_sess_0))
                can_draw_low_sess_0 := false
                label.delete(LBlow_sess_0[0])
            else
                line.set_x2(low_sess_0, bar_index)

// _1
if DOM and show_Sess and show_Sess_1
    var box box_sess_1 = na
    if is_newbar(Sess_1)
        box_sess_1 := box.new(bar_index, high, bar_index, low , border_color = color.new(#c78234, 100), bgcolor = show_Box_Sess ? color.new(col_Sess_1 , 90) : na)
        if Show_OND  
            box.delete(box_sess_1[1]) 
    else if is_session(Sess_1) 
        box.set_right(box_sess_1, bar_index+1)                  
        if high > box.get_top(box_sess_1)
            box.set_top(box_sess_1, high)
        if low < box.get_bottom(box_sess_1)
            box.set_bottom(box_sess_1, low) 

    var bool can_draw_high_sess_1 = false
    var bool can_draw_low_sess_1 = false
    var line high_sess_1 = na 
    var line low_sess_1 = na
    var label LBhigh_sess_1 = na
    var label LBlow_sess_1 = na
    if (is_new_session_NY) and show_Sess_1 and show_Prev_Lin_Sess
        can_draw_high_sess_1 := true   
        can_draw_low_sess_1  := true    
        high_sess_1 := line.new(bar_index, box.get_top(box_sess_1), bar_index, box.get_top(box_sess_1), color = col_Sess_1)    // Get new line id
        low_sess_1  := line.new(bar_index, box.get_bottom(box_sess_1), bar_index, box.get_bottom(box_sess_1), color = col_Sess_1)
        if Show_OND
            line.delete(high_sess_1[1])
            line.delete(low_sess_1[1])
        if show_txt_Lin_Sess
            LBhigh_sess_1 := label.new(x = last_bar_index , y = box.get_top(box_sess_1)    , text = show_price_ses ? txt_Sess_1 +' High '+ str.tostring(box.get_top(box_sess_1)) : txt_Sess_1 +' High ', xloc = xloc.bar_index , yloc = yloc.price , color = na , style = label.style_label_down, textcolor = col_Sess_1 , textalign = text.align_right , tooltip = 'Prev.PM High' )
            LBlow_sess_1  := label.new(x = last_bar_index , y = box.get_bottom(box_sess_1) , text = show_price_ses ? txt_Sess_1 +' Low ' +str.tostring(box.get_bottom(box_sess_1)): txt_Sess_1 +' Low ', xloc = xloc.bar_index , yloc = yloc.price , color = na , style =  label.style_label_center, textcolor = col_Sess_1 , textalign = text.align_right , tooltip = 'Prev.PM Low')
            label.delete(LBhigh_sess_1[1]) 
            label.delete(LBlow_sess_1[1])   
    else
        if (can_draw_high_sess_1)
            if (time > (time_start + 0 * 1000*60) and high > line.get_y1(high_sess_1))
                can_draw_high_sess_1 := false  
                label.delete(LBhigh_sess_1[0])
            else 
                line.set_x2(high_sess_1, bar_index)
        if (can_draw_low_sess_1)
            if (time > (time_start + 0 * 1000*60) and low < line.get_y1(low_sess_1))
                can_draw_low_sess_1 := false
                label.delete(LBlow_sess_1[0])
            else
                line.set_x2(low_sess_1, bar_index)

// _2
if DOM and show_Sess and show_Sess_2
    var box box_sess_2 = na
    if is_newbar(Sess_2)
        box_sess_2 := box.new(bar_index, high, bar_index, low , border_color = color.new(#c78234, 100) , bgcolor = show_Box_Sess ? color.new(col_Sess_2 , 90) : na)
        if Show_OND  
            box.delete(box_sess_2[1]) 
    else if is_session(Sess_2) 
        box.set_right(box_sess_2, bar_index+1)           
        if high > box.get_top(box_sess_2)
            box.set_top(box_sess_2, high)
        if low < box.get_bottom(box_sess_2)
            box.set_bottom(box_sess_2, low) 

    var bool can_draw_high_sess_2 = false
    var bool can_draw_low_sess_2 = false
    var line high_sess_2 = na 
    var line low_sess_2 = na
    var label LBhigh_sess_2 = na
    var label LBlow_sess_2 = na
    if (is_new_session_LC) and show_Sess_2 and show_Prev_Lin_Sess
        can_draw_high_sess_2 := true   
        can_draw_low_sess_2  := true    
        high_sess_2 := line.new(bar_index, box.get_top(box_sess_2), bar_index, box.get_top(box_sess_2), color = col_Sess_2)    // Get new line id
        low_sess_2  := line.new(bar_index, box.get_bottom(box_sess_2), bar_index, box.get_bottom(box_sess_2), color = col_Sess_2)
        if Show_OND
            line.delete(high_sess_2[1])
            line.delete(low_sess_2[1])
        if show_txt_Lin_Sess
            LBhigh_sess_2 := label.new(x = last_bar_index , y = box.get_top(box_sess_2)    , text = show_price_ses ? txt_Sess_2 +' High '+ str.tostring(box.get_top(box_sess_2)) : txt_Sess_2 +' High ', xloc = xloc.bar_index , yloc = yloc.price , color = na , style = label.style_label_down, textcolor = col_Sess_2 , textalign = text.align_right , tooltip = 'Prev.PM High' )
            LBlow_sess_2  := label.new(x = last_bar_index , y = box.get_bottom(box_sess_2) , text = show_price_ses ? txt_Sess_2 +' Low ' +str.tostring(box.get_bottom(box_sess_2)): txt_Sess_2 +' Low ', xloc = xloc.bar_index , yloc = yloc.price , color = na , style =  label.style_label_center, textcolor = col_Sess_2 , textalign = text.align_right , tooltip = 'Prev.PM Low')
            label.delete(LBhigh_sess_2[1]) 
            label.delete(LBlow_sess_2[1])   
    else
        if (can_draw_high_sess_2)
            if (time > (time_start_LC + 0 * 1000*60) or (time_start + 0 * 1000*60) and high > line.get_y1(high_sess_2))
                can_draw_high_sess_2 := false  
                label.delete(LBhigh_sess_2[0]) 
            else
                line.set_x2(high_sess_2, bar_index)
        if (can_draw_low_sess_2)
            if (time > (time_start_LC + 0 * 1000*60) and low < line.get_y1(low_sess_2))
                can_draw_low_sess_2 := false
                label.delete(LBlow_sess_2[0])
            else
                line.set_x2(low_sess_2, bar_index)

// -3
if DOM and show_Sess and show_Sess_3
    var box box_sess_3 = na
    if is_newbar(Sess_3) 
        box_sess_3 := box.new(bar_index, high, bar_index, low , border_color = color.new(#c78234, 100), bgcolor = show_Box_Sess ? color.new(col_Sess_3 , 90) : na)
        if Show_OND  
            box.delete(box_sess_3[2]) 
    else if is_session(Sess_3) 
        box.set_right(box_sess_3, bar_index+1)           
        if high > box.get_top(box_sess_3)
            box.set_top(box_sess_3, high)
        if low < box.get_bottom(box_sess_3)
            box.set_bottom(box_sess_3, low) 

    var bool can_draw_high_sess_3 = false
    var bool can_draw_low_sess_3 = false
    var line high_sess_3 = na 
    var line low_sess_3 = na
    var label LBhigh_sess_3 = na
    var label LBlow_sess_3 = na
    if (is_new_session) and show_Sess_3 and show_Prev_Lin_Sess
        can_draw_high_sess_3 := true   
        can_draw_low_sess_3  := true    
        high_sess_3 := line.new(bar_index, box.get_top(box_sess_3), bar_index, box.get_top(box_sess_3), color = col_Sess_3)    // Get new line id
        low_sess_3  := line.new(bar_index, box.get_bottom(box_sess_3), bar_index, box.get_bottom(box_sess_3), color = col_Sess_3)
        if Show_OND
            line.delete(high_sess_3[1])
            line.delete(low_sess_3[1])
        if show_txt_Lin_Sess
            LBhigh_sess_3 := label.new(x = last_bar_index , y = box.get_top(box_sess_3)    , text = show_price_ses ? txt_Sess_3 +' High '+ str.tostring(box.get_top(box_sess_3)) : txt_Sess_3 +' High ', xloc = xloc.bar_index , yloc = yloc.price , color = na , style = label.style_label_down, textcolor = col_Sess_3 , textalign = text.align_right , tooltip = 'Prev.PM High' )
            LBlow_sess_3  := label.new(x = last_bar_index , y = box.get_bottom(box_sess_3) , text = show_price_ses ? txt_Sess_3 +' Low ' +str.tostring(box.get_bottom(box_sess_3)): txt_Sess_3 +' Low ', xloc = xloc.bar_index , yloc = yloc.price , color = na , style =  label.style_label_center, textcolor = col_Sess_3 , textalign = text.align_right , tooltip = 'Prev.PM Low')
            label.delete(LBhigh_sess_3[1]) 
            label.delete(LBlow_sess_3[1])   
    else 
        if (can_draw_high_sess_3)
            if (time > (time_start + 0 * 1000*60) and high > line.get_y1(high_sess_3))
                can_draw_high_sess_3 := false  
                label.delete(LBhigh_sess_3[0]) 
            else
                line.set_x2(high_sess_3, bar_index)
        if (can_draw_low_sess_3)
            if (time > (time_start + 0 * 1000*60) and low < line.get_y1(low_sess_3))
                can_draw_low_sess_3 := false
                label.delete(LBlow_sess_3[0])
            else
                line.set_x2(low_sess_3, bar_index)

Overview

One Setup for Life ICT displays daily session ranges, Silver Bullet, LN, NY, PM, London, Prev AM, Lunch and PM sessions using New York timezone calculations. The script computes new bar and session status to draw session boxes, lines for starts and ends, previous high/low levels and optional text boxes. Users can toggle visibility and colors for each session type plus limit display to today only. Settings control maximum timeframe and session-specific options.

Details

Published by

alvinng214 on GitHub

Code credit

Giovanni-1, as written in the script's header

Type

Indicator, Pine Script v5

Draws

On the price chart

Category

Sessions & time, Support & resistance

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Max TF Show int15max_tf
Dailybooltrueshow_daily
col_Dcolorcolor.new(color.gray,85)col_D
Sessionboolfalseshow_BR_Sess
Silver Bulletboolfalseshow_BR_SB
LNboolfalseshow_BR_LN
NYboolfalseshow_BR_NY
PMboolfalseshow_BR_PM
Session  booltrueshow_Sess
Box  booltrueshow_Box_Sess
Text Box booltrueshow_txt_box
Prev. H/L booltrueshow_Prev_Lin_Sess
Show all 26 settings
SettingTypeDefaultVariable
Text boolfalseshow_txt_Lin_Sess
Priceboolfalseshow_price_ses
Show Only for TodayboolfalseShow_OND
Start time when you take Prev.H/Lstring09:30choise_start_OSFL
Line Startbooltrueshow_line_start
col_line_startcolorcolor.new(color.orange,60)col_line_start
Londonbooltrueshow_Sess_0
col_Sess_0colorcolor.bluecol_Sess_0
Prev.AMbooltrueshow_Sess_1
    colorcolor.redcol_Sess_1
Lunchbooltrueshow_Sess_2
    colorcolor.yellowcol_Sess_2
PMbooltrueshow_Sess_3
   colorcolor.purplecol_Sess_3
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

575 stars

This indicator builds Market Profile Time Price Opportunity (TPO) structures across defined session timeframes directly on the main price chart. It visualizes the Point of Control (POC) and Value Area boundaries using dynamic box drawings. An integrated multi-

Indicator v5 Support & resistanceScreeners & dashboards
Updated 1 year ago · MPL-2.0 GitHub repository of Market Profile with Screener
257 stars

This indicator plots auto trade signals for E-mini S&P 500 futures on the price chart. It computes an EMA200 filter along with day ETH RTH session levels and percentage-based entry zones. Signals trigger CALL or PUT cases when price crosses defined thresholds

Indicator v6 TrendSupport & resistance
Updated 6 weeks ago · None stated GitHub repository of Auto Trade Futures ES
219 stars

This indicator plots reference levels for previous daily high and low prices directly on the price chart. It requests daily timeframe data using the security function and plots the offset values as continuous lines, displaying resistance in red and support in

Indicator v4 Support & resistanceSessions & time
Updated 5 years ago · None stated GitHub repository of 昨日高低點標示

Golden Bullet Strategy

by TradersPost
218 stars

The Golden Bullet Strategy is an overlay signal indicator based on Smart Money Concepts and time-based liquidity models. It identifies liquidity sweeps of a designated reference session range during a specified hunt window. It then confirms Market Structure Sh

Indicator v6 SMC / ICT / price actionSessions & time
Updated 3 months ago · None stated GitHub repository of Golden Bullet Strategy

Moon Dev GEX Arrows

by moondevonyt
92 stars

This overlay indicator plots option strike walls and an optional session VWAP on the price chart for SPY or ES. It spaces major strikes by the selected instrument, draws a set number of strikes on each side, and marks wall-trap and sweep events after a cooldow

Indicator v5 Support & resistanceSessions & time
Updated 8 weeks ago · Custom licence GitHub repository of Moon Dev GEX Arrows

Key Levels

by cryptorife
75 stars

This indicator plots reference levels and session markers directly on the price chart. It calculates and draws lines for the daily open, weekly open, monthly open, previous day OHLC, and previous week extremes, along with a selectable day-of-week range and ini

Indicator v4 Support & resistanceSessions & time Repaints
Updated 3 years ago · GPL-3.0 GitHub repository of Key Levels

More indicators

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers