Timeframe Bias Table
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © MikeDelgado

//@version=5
indicator("Timeframe Bias Table", "TF Bias", overlay=true)

//input timeframes
inptf1 = input.string('W', '1. Timeframe', inline = '0')
inptf2 = input.string('D', '2. Timeframe', inline = '1')
inptf3 = input.string('4h', '3. Timeframe', inline = '2')
inptf4 = input.string('15m', '4. Timeframe', inline = '3')
inptf5 = input.string('1m', '5. Timeframe', inline = '4')

//input Bias
inp1 = input.string('-', 'Bias', options = ['ᐱ', '-', 'ᐯ',''],inline =  '0')
inp2 = input.string('-', 'Bias', options = ['ᐱ', '-', 'ᐯ',''],inline = '1')
inp3 = input.string('-', 'Bias', options=['ᐱ', '-', 'ᐯ',''] , inline = '2')
inp4 = input.string('-', 'Bias', options=['ᐱ', '-', 'ᐯ',''] , inline = '3')
inp5 = input.string('-', 'Bias', options=['ᐱ', '-', 'ᐯ',''] , inline = '4')

inpColorTF = input.color(color.gray, "TF Color", inline = '5')
inpColorBull = input.color(color.gray, "ᐱ Color", inline = '5')
inpColorBear = input.color(color.gray, "ᐯ Color", inline = '5')
inpColorNeutral = input.color(color.gray, "- Color", inline = '5')


var tbl = table.new(position.top_right, 5, 5, 
 frame_color=color.new(#151715,100), border_width=1, 
 border_color=color.new(color.white, 100))

    // Header
if barstate.islast

//TFs
    table.cell(tbl, 0, 0, inptf1, text_color=inpColorTF)
    table.cell(tbl, 1, 0, inptf2, text_color=inpColorTF)
    table.cell(tbl, 2, 0, inptf3, text_color=inpColorTF)
    table.cell(tbl, 3, 0, inptf4, text_color=inpColorTF)
    table.cell(tbl, 4, 0, inptf5, text_color=inpColorTF)
    
//Bias
    //W
    if inp1=='ᐱ'
        table.cell(tbl, 0, 1, inp1, height=-1, text_color=inpColorBull)
    else if inp1=='ᐯ'
        table.cell(tbl, 0, 1, inp1, text_color=inpColorBear)
    else
        table.cell(tbl, 0, 1, inp1, text_color=inpColorNeutral)
        
    //D
    if inp2=='ᐱ'
        table.cell(tbl, 1, 1, inp2, text_color=inpColorBull)
    else if inp2=='ᐯ'
        table.cell(tbl, 1, 1, inp2, text_color=inpColorBear)
    else
        table.cell(tbl, 1, 1, inp2, text_color=inpColorNeutral)
        
    //4h
    if inp3=='ᐱ'
        table.cell(tbl, 2, 1, inp3, text_color=inpColorBull)
    else if inp3=='ᐯ'
        table.cell(tbl, 2, 1, inp3, text_color=inpColorBear)
    else
        table.cell(tbl, 2, 1, inp3, text_color=inpColorNeutral)
        
    //15m
    if inp4=='ᐱ'
        table.cell(tbl, 3, 1, inp4, text_color=inpColorBull)
    else if inp4=='ᐯ'
        table.cell(tbl, 3, 1, inp4, text_color=inpColorBear)
    else
        table.cell(tbl, 3, 1, inp4, text_color=inpColorNeutral)
        
    //1m
    if inp5=='ᐱ'
        table.cell(tbl, 4, 1, inp5, text_color=inpColorBull)
    else if inp5=='ᐯ'
        table.cell(tbl, 4, 1, inp5, text_color=inpColorBear)
    else
        table.cell(tbl, 4, 1, inp5, text_color=inpColorNeutral)
        
    
        
    
    
    
    
    
