Display Momento -[0.1]-
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © DI-emotion
// Use for education in Discord: The Big Secret Channel 
//@version=5
indicator("Display Momento ", shorttitle = "Momentum Panel", overlay = true)
// receive value from user
sourcebar = input.source(defval = close, title = 'source')
left_tab = input(defval = true , title = 'Turn on/off left tab' , group = '=======Table setting=======')
Panel_header_text_size = input.string(defval =  size.normal , title = 'Header size', options = [size.tiny,size.small,size.normal,size.large,size.huge], group = '=======Table setting=======')
Panel_text_size = input.string(defval = size.small, title = 'Text size',options = [size.tiny,size.small,size.normal,size.large,size.huge], group = '=======Table setting=======')
Panel_pos = input.session(defval = position.top_right , title = 'Panel Position' , options = [position.top_left,position.top_center,position.top_right,position.middle_left,position.middle_center,position.middle_right,position.bottom_left,position.bottom_center,position.bottom_right], group = '=======Table setting=======')
indi_rsi_bool = input(defval = true,title = '', inline = 'rsi' , group = '=======RSI=======')
indi_rsi = input(defval = 14, title = 'RSI' , inline = 'rsi' , group = '=======RSI=======')  
// indi_rsi_middle = input(defval = true, title = 'RSI seperate middle zone?')
indi_stoch_bool = input(defval = true, title ='Stochastic ON/OFF ' , group = '=======Stochastic=======')
indi_stoch_K = input(defval = 14, title = 'Stochastic length' , group = '=======Stochastic=======')
indi_stoch_K_smooth = input.int(defval = 3 , title = 'SmoothK(Stochastic)',minval = 0 , group = '=======Stochastic=======')
indi_stoch_D = input.int(defval = 3, title = 'SmoothD(Stochastic)',minval = 0 , group = '=======Stochastic=======')
indi_atr_bool = input(defval = true, title ='' , inline = 'atr' , group = '=======ATR=======')
indi_atr = input(defval = 14, title = 'ATR' , inline = 'atr' ,  group = '=======ATR=======')
tf1 = input.timeframe(defval = '60' , title = 'Timeframe 1' , group = '=======Timeframe setting=======')
tf2 = input.timeframe(defval = '240' , title = 'Timeframe 2' , group = '=======Timeframe setting=======')
tf3 = input.timeframe(defval = '480' , title = 'Timeframe 3' , group = '=======Timeframe setting=======')
tf4 = input.timeframe(defval = '720' , title = 'Timeframe 4' , group = '=======Timeframe setting=======')
tf5 = input.timeframe(defval = 'D' , title = 'Timeframe 5' , group = '=======Timeframe setting=======')

chart1 = input.symbol(defval = 'BTCUSDT' , title = 'Chart1' , group = '=======Chart setting=======')
chart2 = input.symbol(defval = 'ETHUSDT', title = 'Chart2' , group = '=======Chart setting=======')
chart3 = input.symbol(defval = 'GOLD', title = 'Chart3' , group = '=======Chart setting=======')
chart4 = input.symbol(defval = 'US30', title = 'Chart4' , group = '=======Chart setting=======')
note = input.string(defval = 'Note me :)' , title = 'Note')
// Sad_mode = input.bool(defval = false , title = 'เปิด/ปิดไปก็เท่านั้นก็ยังโสดอยู่ดี55+')
//style tab
rsi_oversold = input.color(defval = color.new(#742421 , 10) , title = 'RSI oversold', group = '=======Color=======')
rsi_bearzone = input.color(defval = color.new(#ec4141, 10) , title = 'RSI bearzone', group = '=======Color=======')
rsi_nature = input.color(defval = color.new(#e47d38, 2) , title = 'RSI nature', group = '=======Color=======')
rsi_bullzone = input.color(defval = color.new(#67f06b, 30) , title = 'RSI bullzone', group = '=======Color=======')
rsi_overbought = input.color(defval = color.new(#2c812f, 30) , title = 'RSI overbought', group = '=======Color=======')
stoch_oversold  = input.color(defval = color.new(#742421 , 10) , title = 'STOCH oversold', group = '=======Color=======')
stoch_bearzone = input.color(defval = color.new(#ec4141, 10) , title = 'STOCH bearzone', group = '=======Color=======')
stoch_overbought = input.color(defval = color.new(#2c812f, 30) , title = 'STOCH overbought', group = '=======Color=======')
stoch_bullzone = input.color(defval = color.new(#67f06b, 30) , title = 'STOCH bullzone', group = '=======Color=======')
stoch_crossup_color = input.color(defval = color.green , title = 'STOCH crossup', group = '=======Color=======')
stoch_crossdown_color = input.color(defval = color.red , title = 'STOCH crossdown', group = '=======Color=======')
atr_color = input.color(defval = color.gray , title = 'ATR', group = '=======Color=======')
// ta set
ta_stoch_K = ta.sma(ta.stoch(sourcebar , high , low , indi_stoch_K) , indi_stoch_K_smooth)
ta_stoch_D = ta.sma(ta_stoch_K , indi_stoch_D)
ta_rsi = ta.rsi(sourcebar, indi_rsi)
ta_atr = ta.atr(indi_atr)
//rsi tf
ta_rsi_1 = request.security(syminfo.tickerid , tf1 , ta_rsi)
ta_rsi_2 = request.security(syminfo.tickerid , tf2 , ta_rsi)
ta_rsi_3 = request.security(syminfo.tickerid , tf3 , ta_rsi)
ta_rsi_4 = request.security(syminfo.tickerid , tf4 , ta_rsi)
ta_rsi_5 = request.security(syminfo.tickerid , tf5 , ta_rsi)
//%K stoch tf
ta_stoch_1 = request.security(syminfo.tickerid , tf1 , ta_stoch_K)
ta_stoch_2 = request.security(syminfo.tickerid , tf2 , ta_stoch_K)
ta_stoch_3 = request.security(syminfo.tickerid , tf3 , ta_stoch_K)
ta_stoch_4 = request.security(syminfo.tickerid , tf4 , ta_stoch_K)
ta_stoch_5 = request.security(syminfo.tickerid , tf5 , ta_stoch_K)
//%D Stoch tf
ta_stoch_D_1 = request.security(syminfo.tickerid , tf1 , ta_stoch_D)
ta_stoch_D_2 = request.security(syminfo.tickerid , tf2 , ta_stoch_D)
ta_stoch_D_3 = request.security(syminfo.tickerid , tf3 , ta_stoch_D)
ta_stoch_D_4 = request.security(syminfo.tickerid , tf4 , ta_stoch_D)
ta_stoch_D_5 = request.security(syminfo.tickerid , tf5 , ta_stoch_D)
//atr tf
ta_atr_1 = request.security(syminfo.ticker , tf1 , ta_atr)
ta_atr_2 = request.security(syminfo.ticker , tf2 , ta_atr)
ta_atr_3 = request.security(syminfo.ticker , tf3 , ta_atr)
ta_atr_4 = request.security(syminfo.ticker , tf4 , ta_atr)
ta_atr_5 = request.security(syminfo.ticker , tf5 , ta_atr)

//TF
tf_list = array.new_string(112 , '')
array.set(tf_list , 0 , tf1)
array.set(tf_list , 1 , tf2)
array.set(tf_list , 2 , tf3)
array.set(tf_list , 3 , tf4)
array.set(tf_list , 4 , tf5)

//array chart list
chart_list = array.new_string(112 , '')
array.set(chart_list , 0 , chart1)
array.set(chart_list , 1 , chart2)
array.set(chart_list , 2 , chart3)
array.set(chart_list , 3 , chart4)

// symbol rsi 
rsi_symbol_1 = array.new_float(800 , 0)
array.set(rsi_symbol_1 , 0 , request.security(chart1 , '' , ta_rsi))
array.set(rsi_symbol_1 , 1 , request.security(chart1 , tf1 , ta_rsi))
array.set(rsi_symbol_1 , 2 , request.security(chart1 , tf2 , ta_rsi))
array.set(rsi_symbol_1 , 3 , request.security(chart1 , tf3 , ta_rsi))
array.set(rsi_symbol_1 , 4 , request.security(chart1 , tf4 , ta_rsi))
array.set(rsi_symbol_1 , 5 , request.security(chart1 , tf5 , ta_rsi))

rsi_symbol_2 = array.new_float(800 , 0)
array.set(rsi_symbol_2 , 0 , request.security(chart2 , '' , ta_rsi))
array.set(rsi_symbol_2 , 1 , request.security(chart2 , tf1 , ta_rsi))
array.set(rsi_symbol_2 , 2 , request.security(chart2 , tf2 , ta_rsi))
array.set(rsi_symbol_2 , 3 , request.security(chart2 , tf3 , ta_rsi))
array.set(rsi_symbol_2 , 4 , request.security(chart2 , tf4 , ta_rsi))
array.set(rsi_symbol_2 , 5 , request.security(chart2 , tf5 , ta_rsi))

rsi_symbol_3 = array.new_float(800 , 0)
array.set(rsi_symbol_3 , 0 , request.security(chart3 , '' , ta_rsi))
array.set(rsi_symbol_3 , 1 , request.security(chart3 , tf1 , ta_rsi))
array.set(rsi_symbol_3 , 2 , request.security(chart3 , tf2 , ta_rsi))
array.set(rsi_symbol_3 , 3 , request.security(chart3 , tf3 , ta_rsi))
array.set(rsi_symbol_3 , 4 , request.security(chart3 , tf4 , ta_rsi))
array.set(rsi_symbol_3 , 5 , request.security(chart3 , tf5 , ta_rsi))
//limit secure request symbol 4 was close
// rsi_symbol_4 = array.new_float(800 , 0)
// array.set(rsi_symbol_4 , 0 , request.security(chart4 , '' , ta_rsi))
// array.set(rsi_symbol_4 , 1 , request.security(chart4 , tf1 , ta_rsi))
// array.set(rsi_symbol_4 , 2 , request.security(chart4 , tf2 , ta_rsi))
// array.set(rsi_symbol_4 , 3 , request.security(chart4 , tf3 , ta_rsi))
// array.set(rsi_symbol_4 , 4 , request.security(chart4 , tf4 , ta_rsi))
// array.set(rsi_symbol_4 , 5 , request.security(chart4 , tf5 , ta_rsi))


//rsi array set
rsi_value = array.new_float(800 , 0)
rsi_color = array.new_color(800 , color.black)

array.set(rsi_value , 0 , ta_rsi)
array.set(rsi_value , 1 , ta_rsi_1)
array.set(rsi_value , 2 , ta_rsi_2)
array.set(rsi_value , 3 , ta_rsi_3)
array.set(rsi_value , 4 , ta_rsi_4)
array.set(rsi_value , 5 , ta_rsi_5)

//stoch color upto value
stoch_value = array.new_float(800 , 0 )
stoch_value_d = array.new_float(800 , 0)
stoch_cross = array.new_string(800 , '')
stoch_color = array.new_color(800 , color.black)
stoch_cross_color = array.new_color(800 , color.yellow)
//%k stoch array set
array.set(stoch_value , 0 , ta_stoch_K)
array.set(stoch_value , 1 , ta_stoch_1)
array.set(stoch_value , 2 , ta_stoch_2)
array.set(stoch_value , 3 , ta_stoch_3)
array.set(stoch_value , 4 , ta_stoch_4)
array.set(stoch_value , 5 , ta_stoch_5)
// %d stoch array set
array.set(stoch_value_d , 0 , ta_stoch_D)
array.set(stoch_value_d , 1 , ta_stoch_D_1)
array.set(stoch_value_d , 2 , ta_stoch_D_2)
array.set(stoch_value_d , 3 , ta_stoch_D_3)
array.set(stoch_value_d , 4 , ta_stoch_D_4)
array.set(stoch_value_d , 4 , ta_stoch_D_5)
//atr array set
atr_value = array.new_float(800, 0)
atr_string = array.new_string(800, '')
array.set(atr_value , 0 , ta_atr)
array.set(atr_value , 1 , ta_atr_1)
array.set(atr_value , 2 , ta_atr_2)
array.set(atr_value , 3 , ta_atr_3)
array.set(atr_value , 4 , ta_atr_4)
array.set(atr_value , 5 , ta_atr_5)
//atr filter
rsi_symbol_1_color = array.new_color(800 , color.black)
rsi_symbol_2_color = array.new_color(800 , color.black)
rsi_symbol_3_color = array.new_color(800 , color.black)
//add hr to string tf
for i = 0 to 4
    if str.tonumber(array.get(tf_list , i)) >= 60
        array.set(tf_list , i , str.tostring(str.tonumber(array.get(tf_list , i))/60) + 'HR')
//bg rsi symbol 1
for i = 0 to 5
    if array.get(rsi_symbol_1 , i) < 30
        array.set(rsi_symbol_1_color , i , rsi_oversold)
    if array.get(rsi_symbol_1 , i) < 50 and array.get(rsi_symbol_1 , i) > 30
        array.set(rsi_symbol_1_color , i , rsi_bearzone)
    if array.get(rsi_symbol_1 , i) > 50 and array.get(rsi_symbol_1 , i) < 60
        array.set(rsi_symbol_1_color , i , rsi_nature)
    if array.get(rsi_symbol_1 , i) > 60 and array.get(rsi_symbol_1 , i) < 70
        array.set(rsi_symbol_1_color , i , rsi_bullzone)
    if array.get(rsi_symbol_1 , i) > 70
        array.set(rsi_symbol_1_color , i , rsi_overbought)
//bg rsi symbol 2
    if array.get(rsi_symbol_2 , i) < 30
        array.set(rsi_symbol_2_color , i , rsi_oversold)
    if array.get(rsi_symbol_2 , i) < 50 and array.get(rsi_symbol_2 , i) > 30
        array.set(rsi_symbol_2_color , i , rsi_bearzone)
    if array.get(rsi_symbol_2 , i) > 50 and array.get(rsi_symbol_2 , i) < 60
        array.set(rsi_symbol_2_color , i , rsi_nature)
    if array.get(rsi_symbol_2 , i) > 60 and array.get(rsi_symbol_2 , i) < 70
        array.set(rsi_symbol_2_color , i , rsi_bullzone)
    if array.get(rsi_symbol_2 , i) > 70
        array.set(rsi_symbol_2_color , i , rsi_overbought)
//bg rsi symbol 3
    if array.get(rsi_symbol_3 , i) < 30
        array.set(rsi_symbol_3_color , i , rsi_oversold)
    if array.get(rsi_symbol_3 , i) < 50 and array.get(rsi_symbol_3 , i) > 30
        array.set(rsi_symbol_3_color , i , rsi_bearzone)
    if array.get(rsi_symbol_3 , i) > 50 and array.get(rsi_symbol_3 , i) < 60
        array.set(rsi_symbol_3_color , i , rsi_nature)
    if array.get(rsi_symbol_3 , i) > 60 and array.get(rsi_symbol_3 , i) < 70
        array.set(rsi_symbol_3_color , i , rsi_bullzone)
    if array.get(rsi_symbol_3 , i) > 70
        array.set(rsi_symbol_3_color , i , rsi_overbought)


// for i= 0 to 5
//     if array.get(atr_value , i) < 0.01
//         array.set(rsi_symbol_1 , i , '#.######')

//bg rsi upto value
for i = 0 to 5
    if array.get(rsi_value , i) < 30
        array.set(rsi_color , i , rsi_oversold)
    if array.get(rsi_value , i)<50 and array.get(rsi_value , i) > 30
        array.set(rsi_color , i , rsi_bearzone)
    if array.get(rsi_value , i)>50 and array.get(rsi_value , i)<60
        array.set(rsi_color , i , rsi_nature)
    if array.get(rsi_value , i)>60 and array.get(rsi_value , i) < 70
        array.set(rsi_color , i , rsi_bullzone)
    if array.get(rsi_value , i)>70
        array.set(rsi_color , i , rsi_overbought)
//bg stoch upto value
for i = 0 to 5
    if array.get(stoch_value , i) > 70
        array.set(stoch_color , i , stoch_overbought)
    if array.get(stoch_value , i) > 50 and array.get(stoch_value , i) <70
        array.set(stoch_color , i , stoch_bullzone)
    if array.get(stoch_value , i) > 30 and array.get(stoch_value , i) <50
        array.set(stoch_color , i , stoch_bearzone)
    if array.get(stoch_value , i) < 30
        array.set(stoch_color , i , stoch_oversold)
//stoch cross + bg stoch cross upto value
for i = 0 to 5
    if array.get(stoch_value, i) > array.get(stoch_value_d, i)
        array.set(stoch_cross , i , 'Crossup' )
        array.set(stoch_cross_color , i , stoch_crossup_color)
    else 
        array.set(stoch_cross , i , 'Crossdown' )
        array.set(stoch_cross_color , i , stoch_crossdown_color)
        

//table set
var table1 = table.new(Panel_pos, 30, 30, bgcolor = color.rgb(68, 68, 68, 28), border_width = 1, border_color = color.rgb(255, 255, 255))
table.set_frame_color(table1 , color.white)
table.set_frame_width(table1 , 1)
if left_tab == true
    table.cell(table1, 0 , 0 , text = '𓁹 ‿ 𓁹' , text_color = color.white , text_size = Panel_text_size )
    table.cell(table1, 0 , 1 , text = 'WatchList' , text_color = color.white , text_size = Panel_text_size )
    table.cell(table1, 0 , 2 , text = 'Current chart' , text_color = color.white , text_size = Panel_text_size)
    table.cell(table1, 0 , 3 , text =  chart1 , text_color = color.white , text_size = Panel_text_size)
    table.cell(table1, 0 , 4 , text =  chart2 , text_color = color.white , text_size = Panel_text_size)
    table.cell(table1, 0 , 5 , text =  chart3 , text_color = color.white , text_size = Panel_text_size)
    table.cell(table1, 0 , 6 , text =  'Note' , text_color = color.rgb(255, 255, 255) , text_size = Panel_text_size)
if indi_rsi_bool==true
    table.merge_cells(table1 , 1, 6 , 6, 6)
    table.merge_cells(table1 , 1, 0 ,6 ,0 )
    //rsi symbol 1
    table.cell(table1,1,3,str.tostring(array.get(rsi_symbol_1 , 0), '#.##'), text_color = color.white , text_size = Panel_text_size , bgcolor = array.get(rsi_symbol_1_color , 0))
    table.cell(table1,2,3,str.tostring(array.get(rsi_symbol_1 , 1), '#.##'), text_color = color.white , text_size = Panel_text_size , bgcolor = array.get(rsi_symbol_1_color , 1))
    table.cell(table1,3,3,str.tostring(array.get(rsi_symbol_1 , 2), '#.##'), text_color = color.white , text_size = Panel_text_size , bgcolor = array.get(rsi_symbol_1_color , 2))
    table.cell(table1,4,3,str.tostring(array.get(rsi_symbol_1 , 3), '#.##'), text_color = color.white , text_size = Panel_text_size , bgcolor = array.get(rsi_symbol_1_color , 3))
    table.cell(table1,5,3,str.tostring(array.get(rsi_symbol_1 , 4), '#.##'), text_color = color.white , text_size = Panel_text_size , bgcolor = array.get(rsi_symbol_1_color , 4))
    table.cell(table1,6,3,str.tostring(array.get(rsi_symbol_1 , 5), '#.##'), text_color = color.white , text_size = Panel_text_size , bgcolor = array.get(rsi_symbol_1_color , 5))
    //rsi symbol 2 , bgcolor = array.get(rsi_symbol_1_color , ))
    table.cell(table1,1,4,str.tostring(array.get(rsi_symbol_2 , 0), '#.##'), text_color = color.white , text_size = Panel_text_size , bgcolor = array.get(rsi_symbol_2_color , 0))
    table.cell(table1,2,4,str.tostring(array.get(rsi_symbol_2 , 1), '#.##'), text_color = color.white , text_size = Panel_text_size , bgcolor = array.get(rsi_symbol_2_color , 1))
    table.cell(table1,3,4,str.tostring(array.get(rsi_symbol_2 , 2), '#.##'), text_color = color.white , text_size = Panel_text_size , bgcolor = array.get(rsi_symbol_2_color , 2))
    table.cell(table1,4,4,str.tostring(array.get(rsi_symbol_2 , 3), '#.##'), text_color = color.white , text_size = Panel_text_size , bgcolor = array.get(rsi_symbol_2_color , 3))
    table.cell(table1,5,4,str.tostring(array.get(rsi_symbol_2 , 4), '#.##'), text_color = color.white , text_size = Panel_text_size , bgcolor = array.get(rsi_symbol_2_color , 4))
    table.cell(table1,6,4,str.tostring(array.get(rsi_symbol_2 , 5), '#.##'), text_color = color.white , text_size = Panel_text_size , bgcolor = array.get(rsi_symbol_2_color , 5))
    //rsi symbol 3 , bgcolor = array.get(rsi_symbol_1_color , ))
    table.cell(table1,1,5,str.tostring(array.get(rsi_symbol_3 , 0), '#.##'), text_color = color.white , text_size = Panel_text_size , bgcolor = array.get(rsi_symbol_3_color , 0))
    table.cell(table1,2,5,str.tostring(array.get(rsi_symbol_3 , 1), '#.##'), text_color = color.white , text_size = Panel_text_size , bgcolor = array.get(rsi_symbol_3_color , 1))
    table.cell(table1,3,5,str.tostring(array.get(rsi_symbol_3 , 2), '#.##'), text_color = color.white , text_size = Panel_text_size , bgcolor = array.get(rsi_symbol_3_color , 2))
    table.cell(table1,4,5,str.tostring(array.get(rsi_symbol_3 , 3), '#.##'), text_color = color.white , text_size = Panel_text_size , bgcolor = array.get(rsi_symbol_3_color , 3))
    table.cell(table1,5,5,str.tostring(array.get(rsi_symbol_3 , 4), '#.##'), text_color = color.white , text_size = Panel_text_size , bgcolor = array.get(rsi_symbol_3_color , 4))
    table.cell(table1,6,5,str.tostring(array.get(rsi_symbol_3 , 5), '#.##'), text_color = color.white , text_size = Panel_text_size , bgcolor = array.get(rsi_symbol_3_color , 5))
    //Interest chart 
    table.cell(table1, 1 , 6 , text =  note , text_color = color.white , text_size = Panel_text_size)
    //rsi symbol 4 // limit secure
    // table.cell(table1,1,6,str.tostring(array.get(rsi_symbol_4 , 0), '#.##'), text_color = color.white , text_size = Panel_text_size)
    // table.cell(table1,2,6,str.tostring(array.get(rsi_symbol_4 , 1), '#.##'), text_color = color.white , text_size = Panel_text_size)
    // table.cell(table1,3,6,str.tostring(array.get(rsi_symbol_4 , 2), '#.##'), text_color = color.white , text_size = Panel_text_size)
    // table.cell(table1,4,6,str.tostring(array.get(rsi_symbol_4 , 3), '#.##'), text_color = color.white , text_size = Panel_text_size)
    // table.cell(table1,5,6,str.tostring(array.get(rsi_symbol_4 , 4), '#.##'), text_color = color.white , text_size = Panel_text_size)
    // table.cell(table1,6,6,str.tostring(array.get(rsi_symbol_4 , 5), '#.##'), text_color = color.white , text_size = Panel_text_size)
    //rsi current chart
    table.cell(table1,1,0,text = 'RSI',text_color = color.white , text_size = Panel_header_text_size , bgcolor = color.rgb(0, 0, 0)) //header
    table.cell(table1,1,1,text = 'CURRENT TF',text_color = color.white , text_size = Panel_text_size)
    table.cell(table1,2,1,text = array.get(tf_list , 0),text_color = color.white , text_size = Panel_text_size)
    table.cell(table1,3,1,text = array.get(tf_list , 1),text_color = color.white , text_size = Panel_text_size)
    table.cell(table1,4,1,text = array.get(tf_list , 2),text_color = color.white , text_size = Panel_text_size)
    table.cell(table1,5,1,text = array.get(tf_list , 3),text_color = color.white , text_size = Panel_text_size)
    table.cell(table1,6,1,text = array.get(tf_list , 4),text_color = color.white , text_size = Panel_text_size)
    table.cell(table1,1,2,str.tostring(ta_rsi, '#.##'), text_color = color.white , bgcolor = (array.get(rsi_color , 0)) , text_size = Panel_text_size )
    table.cell(table1,2,2,str.tostring(ta_rsi_1, '#.##'), text_color = color.white , bgcolor = (array.get(rsi_color , 1)) , text_size = Panel_text_size )
    table.cell(table1,3,2,str.tostring(ta_rsi_2, '#.##'), text_color = color.white , bgcolor = (array.get(rsi_color , 2)) , text_size = Panel_text_size )
    table.cell(table1,4,2,str.tostring(ta_rsi_3, '#.##'), text_color = color.white , bgcolor = (array.get(rsi_color , 3)) , text_size = Panel_text_size )
    table.cell(table1,5,2,str.tostring(ta_rsi_4, '#.##'), text_color = color.white , bgcolor = (array.get(rsi_color , 4)) , text_size = Panel_text_size )
    table.cell(table1,6,2,str.tostring(ta_rsi_5, '#.##'), text_color = color.white , bgcolor = (array.get(rsi_color , 5)) , text_size = Panel_text_size )
    // table.cell(table1,2,1,str.tostring(ta_rsi_1hr[1], '#.##'), text_color = color.white , bgcolor = (bg_color_rsi) , text_size = Panel_text_size )
if indi_stoch_bool == true
    table.merge_cells(table1 , 7 , 0 , 12 , 0)
    table.cell(table1,7,0,text = 'STOCH', text_color = color.white , text_size = Panel_header_text_size , bgcolor = color.rgb(0, 0, 0)) //header
    table.cell(table1,7,1,text = 'CURRENT TF' , text_color = color.white , text_size = Panel_text_size)
    table.cell(table1,8,1,text = array.get(tf_list , 0), text_color = color.white , text_size = Panel_text_size)
    table.cell(table1,9,1,text = array.get(tf_list , 1), text_color = color.white , text_size = Panel_text_size)
    table.cell(table1,10,1,text = array.get(tf_list , 2), text_color = color.white , text_size = Panel_text_size)
    table.cell(table1,11,1,text = array.get(tf_list , 3), text_color = color.white , text_size = Panel_text_size)
    table.cell(table1,12,1,text = array.get(tf_list , 4), text_color = color.white , text_size = Panel_text_size)
    table.cell(table1,7,2,str.tostring(ta_stoch_K,'#.##'), text_color = color.white , bgcolor = array.get(stoch_color , 0) , text_size = Panel_text_size)
    table.cell(table1,8,2,str.tostring(ta_stoch_1,'#.##'), text_color = color.white , bgcolor = array.get(stoch_color , 1) , text_size = Panel_text_size)
    table.cell(table1,9,2,str.tostring(ta_stoch_2,'#.##'), text_color = color.white , bgcolor = array.get(stoch_color , 2) , text_size = Panel_text_size)
    table.cell(table1,10,2,str.tostring(ta_stoch_3,'#.##'), text_color = color.white , bgcolor = array.get(stoch_color , 3) , text_size = Panel_text_size)
    table.cell(table1,11,2,str.tostring(ta_stoch_4,'#.##'), text_color = color.white , bgcolor = array.get(stoch_color , 4) , text_size = Panel_text_size)
    table.cell(table1,12,2,str.tostring(ta_stoch_5,'#.##'), text_color = color.white , bgcolor = array.get(stoch_color , 5) , text_size = Panel_text_size)
    table.cell(table1,7,3, text = array.get(stoch_cross , 0) , text_color = color.white , bgcolor = array.get(stoch_cross_color , 0) , text_size = Panel_text_size)
    table.cell(table1,8,3, text = array.get(stoch_cross , 1) , text_color = color.white , bgcolor = array.get(stoch_cross_color , 1) , text_size = Panel_text_size)
    table.cell(table1,9,3, text = array.get(stoch_cross , 2) , text_color = color.white , bgcolor = array.get(stoch_cross_color , 2) , text_size = Panel_text_size)
    table.cell(table1,10,3, text = array.get(stoch_cross , 3) , text_color = color.white , bgcolor = array.get(stoch_cross_color , 3) , text_size = Panel_text_size)
    table.cell(table1,11,3, text = array.get(stoch_cross , 4) , text_color = color.white , bgcolor = array.get(stoch_cross_color , 4) , text_size = Panel_text_size)
    table.cell(table1,12,3, text = array.get(stoch_cross , 5) , text_color = color.white , bgcolor = array.get(stoch_cross_color , 5) , text_size = Panel_text_size)
if indi_atr_bool == true 
    if close < 0.001
        table.merge_cells(table1 , 7 , 4 , 12 , 4)
        table.cell(table1,7,4,text = 'ATR', text_color = color.white , text_size = Panel_header_text_size , bgcolor = color.rgb(0, 0, 0)) //header
        table.cell(table1,7,5,text = 'CURRENT TF', text_color = color.white , text_size = Panel_text_size)
        table.cell(table1,8,5,text = array.get(tf_list , 0), text_color = color.white , text_size = Panel_text_size)
        table.cell(table1,9,5,text = array.get(tf_list , 1), text_color = color.white , text_size = Panel_text_size)
        table.cell(table1,10,5,text = array.get(tf_list , 2), text_color = color.white , text_size = Panel_text_size)
        table.cell(table1,11,5,text = array.get(tf_list , 3), text_color = color.white , text_size = Panel_text_size)
        table.cell(table1,12,5,text = array.get(tf_list , 4), text_color = color.white , text_size = Panel_text_size)
        table.cell(table1,7,6,str.tostring(ta_atr,'#.########'), text_color = color.white , bgcolor = atr_color , text_size = Panel_text_size)
        table.cell(table1,8,6,str.tostring(ta_atr_1,'#.########'), text_color = color.white , bgcolor = atr_color, text_size = Panel_text_size)
        table.cell(table1,9,6,str.tostring(ta_atr_2,'#.########'), text_color = color.white , bgcolor = atr_color , text_size = Panel_text_size)
        table.cell(table1,10,6,str.tostring(ta_atr_3,'#.########'), text_color = color.white , bgcolor = atr_color , text_size = Panel_text_size)
        table.cell(table1,11,6,str.tostring(ta_atr_4,'#.########'), text_color = color.white , bgcolor = atr_color , text_size = Panel_text_size)
        table.cell(table1,12,6,str.tostring(ta_atr_5,'#.########'), text_color = color.white , bgcolor = atr_color , text_size = Panel_text_size)
    if close < 0.01 and close > 0.001
        table.merge_cells(table1 , 7 , 4 , 12 , 4)
        table.cell(table1,7,4,text = 'ATR', text_color = color.white , text_size = Panel_header_text_size , bgcolor = color.rgb(0, 0, 0)) //header
        table.cell(table1,7,5,text = 'CURRENT TF', text_color = color.white , text_size = Panel_text_size)
        table.cell(table1,8,5,text = array.get(tf_list , 0), text_color = color.white , text_size = Panel_text_size)
        table.cell(table1,9,5,text = array.get(tf_list , 1), text_color = color.white , text_size = Panel_text_size)
        table.cell(table1,10,5,text = array.get(tf_list , 2), text_color = color.white , text_size = Panel_text_size)
        table.cell(table1,11,5,text = array.get(tf_list , 3), text_color = color.white , text_size = Panel_text_size)
        table.cell(table1,12,5,text = array.get(tf_list , 4), text_color = color.white , text_size = Panel_text_size)
        table.cell(table1,7,6,str.tostring(ta_atr,'#.######'), text_color = color.white , bgcolor = atr_color , text_size = Panel_text_size)
        table.cell(table1,8,6,str.tostring(ta_atr_1,'#.######'), text_color = color.white , bgcolor = atr_color, text_size = Panel_text_size)
        table.cell(table1,9,6,str.tostring(ta_atr_2,'#.#######'), text_color = color.white , bgcolor = atr_color , text_size = Panel_text_size)
        table.cell(table1,10,6,str.tostring(ta_atr_3,'#.#######'), text_color = color.white , bgcolor = atr_color , text_size = Panel_text_size)
        table.cell(table1,11,6,str.tostring(ta_atr_4,'#.#######'), text_color = color.white , bgcolor = atr_color , text_size = Panel_text_size)
        table.cell(table1,12,6,str.tostring(ta_atr_5,'#.#######'), text_color = color.white , bgcolor = atr_color , text_size = Panel_text_size)
    if close < 0.1 and close > 0.01
        table.merge_cells(table1 , 7 , 4 , 12 , 4)
        table.cell(table1,7,4,text = 'ATR', text_color = color.white , text_size = Panel_header_text_size , bgcolor = color.rgb(0, 0, 0)) //header
        table.cell(table1,7,5,text = 'CURRENT TF', text_color = color.white , text_size = Panel_text_size)
        table.cell(table1,8,5,text = array.get(tf_list , 0), text_color = color.white , text_size = Panel_text_size)
        table.cell(table1,9,5,text = array.get(tf_list , 1), text_color = color.white , text_size = Panel_text_size)
        table.cell(table1,10,5,text = array.get(tf_list , 2), text_color = color.white , text_size = Panel_text_size)
        table.cell(table1,11,5,text = array.get(tf_list , 3), text_color = color.white , text_size = Panel_text_size)
        table.cell(table1,12,5,text = array.get(tf_list , 4), text_color = color.white , text_size = Panel_text_size)
        table.cell(table1,7,6,str.tostring(ta_atr,'#.#####'), text_color = color.white , bgcolor = atr_color , text_size = Panel_text_size)
        table.cell(table1,8,6,str.tostring(ta_atr_1,'#.#####'), text_color = color.white , bgcolor = atr_color, text_size = Panel_text_size)
        table.cell(table1,9,6,str.tostring(ta_atr_2,'#.#####'), text_color = color.white , bgcolor = atr_color , text_size = Panel_text_size)
        table.cell(table1,10,6,str.tostring(ta_atr_3,'#.#####'), text_color = color.white , bgcolor = atr_color , text_size = Panel_text_size)
        table.cell(table1,11,6,str.tostring(ta_atr_4,'#.#####'), text_color = color.white , bgcolor = atr_color , text_size = Panel_text_size)
        table.cell(table1,12,6,str.tostring(ta_atr_5,'#.#####'), text_color = color.white , bgcolor = atr_color , text_size = Panel_text_size)
    if close < 10 and close > 0
        table.merge_cells(table1 , 7 , 4 , 12 , 4)
        table.cell(table1,7,4,text = 'ATR', text_color = color.white , text_size = Panel_header_text_size , bgcolor = color.rgb(0, 0, 0)) //header
        table.cell(table1,7,5,text = 'CURRENT TF', text_color = color.white , text_size = Panel_text_size)
        table.cell(table1,8,5,text = array.get(tf_list , 0), text_color = color.white , text_size = Panel_text_size)
        table.cell(table1,9,5,text = array.get(tf_list , 1), text_color = color.white , text_size = Panel_text_size)
        table.cell(table1,10,5,text = array.get(tf_list , 2), text_color = color.white , text_size = Panel_text_size)
        table.cell(table1,11,5,text = array.get(tf_list , 3), text_color = color.white , text_size = Panel_text_size)
        table.cell(table1,12,5,text = array.get(tf_list , 4), text_color = color.white , text_size = Panel_text_size)
        table.cell(table1,7,6,str.tostring(ta_atr,'#.####'), text_color = color.white , bgcolor = atr_color , text_size = Panel_text_size)
        table.cell(table1,8,6,str.tostring(ta_atr_1,'#.####'), text_color = color.white , bgcolor = atr_color, text_size = Panel_text_size)
        table.cell(table1,9,6,str.tostring(ta_atr_2,'#.###'), text_color = color.white , bgcolor = atr_color , text_size = Panel_text_size)
        table.cell(table1,10,6,str.tostring(ta_atr_3,'#.###'), text_color = color.white , bgcolor = atr_color , text_size = Panel_text_size)
        table.cell(table1,11,6,str.tostring(ta_atr_4,'#.###'), text_color = color.white , bgcolor = atr_color , text_size = Panel_text_size)
        table.cell(table1,12,6,str.tostring(ta_atr_5,'#.###'), text_color = color.white , bgcolor = atr_color , text_size = Panel_text_size)
    else if close > 10
        table.merge_cells(table1 , 7 , 4 , 12 , 4)
        table.cell(table1,7,4,text = 'ATR', text_color = color.white , text_size = Panel_header_text_size , bgcolor = color.rgb(0, 0, 0)) //header
        table.cell(table1,7,5,text = 'CURRENT TF', text_color = color.white , text_size = Panel_text_size)
        table.cell(table1,8,5,text = array.get(tf_list , 0), text_color = color.white , text_size = Panel_text_size)
        table.cell(table1,9,5,text = array.get(tf_list , 1), text_color = color.white , text_size = Panel_text_size)
        table.cell(table1,10,5,text = array.get(tf_list , 2), text_color = color.white , text_size = Panel_text_size)
        table.cell(table1,11,5,text = array.get(tf_list , 3), text_color = color.white , text_size = Panel_text_size)
        table.cell(table1,12,5,text = array.get(tf_list , 4), text_color = color.white , text_size = Panel_text_size)
        table.cell(table1,7,6,str.tostring(ta_atr,'#.##'), text_color = color.white , bgcolor = atr_color , text_size = Panel_text_size)
        table.cell(table1,8,6,str.tostring(ta_atr_1,'#.##'), text_color = color.white , bgcolor = atr_color, text_size = Panel_text_size)
        table.cell(table1,9,6,str.tostring(ta_atr_2,'#.##'), text_color = color.white , bgcolor = atr_color , text_size = Panel_text_size)
        table.cell(table1,10,6,str.tostring(ta_atr_3,'#.#'), text_color = color.white , bgcolor = atr_color , text_size = Panel_text_size)
        table.cell(table1,11,6,str.tostring(ta_atr_4,'#.#'), text_color = color.white , bgcolor = atr_color , text_size = Panel_text_size)
        table.cell(table1,12,6,str.tostring(ta_atr_5,'#.#'), text_color = color.white , bgcolor = atr_color , text_size = Panel_text_size)