Candle Combo Screener
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Amphibiantrading

//@version=5
indicator("Candle Combo Screener", shorttitle = 'CCS', overlay = true)

//inputs
var g1 = 'Candle Combos'
kickerBool =    input.bool(true, 'Kicker', inline = '1', group = g1)
oopsBool =      input.bool(true, 'Oops Reversals', inline = '1', group = g1)
oelBool =       input.bool(true, 'Open is High / Low', inline = '2', group = g1)
insideBool =    input.bool(true, 'Inside / Engulfing', inline = '2', group = g1)

var g2 = 'Symbols'
sym1 =      input.symbol('TSLA', 'Symbol 1', inline = '3', group = g2)
sym2 =      input.symbol('NVDA', 'Symbol 2', inline = '4', group = g2)
sym3 =      input.symbol('MELI', 'Symbol 3', inline = '5', group = g2)
sym4 =      input.symbol('SE', 'Symbol 4', inline = '6', group = g2)
sym5 =      input.symbol('ABNB', 'Symbol 5', inline = '7', group = g2)

var g3 = 'Table Options'
showTable =         input.bool(true, 'Show Table', group = g3)
doubleTable =       input.bool(false, 'Second Instance', inline = '1', group = g3)
thirdTable =        input.bool(false, 'Third Instance', inline = '1', group = g3, tooltip = 'Use this setting if you are adding this indicator to the chart multiple times. This will allow the charts to line up and look as one larger table. Table position must be set to "Top"')
i_tableypos =       input.string("Top", "Y", options = ["Top", "Middle", "Bottom"], inline = "13",  group= g3)
i_tablexpos =       input.string("Right", "X", options = ["Right","Center", "Left"], inline = "13",  group = g3)
tableTextSize =     input.string("Normal", "Table Size", options = ["Small","Normal","Large","Huge"], inline = '14', group = g3)
tableTextColor =    input.color(color.white, 'Table Values Text Color', inline = '14', group = g3)
tableHeaderColor =  input.color(color.black, 'Header Text Color', inline = '15', group = g3)
tableBgColor =      input.color(color.rgb(230, 230, 230), 'Table Background Color', inline = '15', group = g3)
bullColor =         input.color(color.green, 'Bullish Combo Color', inline = '16', group = g3)
bearColor =         input.color(color.red, 'Bearish Combo Color', inline = '16', group = g3)

//Table
var table screener = table.new(str.lower(i_tableypos) + "_" + str.lower(i_tablexpos), 15, 18, color.new(color.white,100), color.black, 1, color.black, 1)

// methods
method splitter(string sym) =>
    array.get(str.split(sym, ':'),1)

method textsize(string this) =>
    switch this
        'Normal' => size.normal
        'Small' => size.small
        'Large' => size.large
        'Huge' => size.huge

method data(string sym)=>
    yestOpen = request.security(sym,'D',open[1]), yestClose = request.security(sym,'D',close[1])
    yestHigh = request.security(sym,'D',high[1]), yestLow = request.security(sym,'D',low[1])
    todayOpen = request.security(sym,'D',open), todayClose = request.security(sym,'D',close)
    todayHigh = request.security(sym,'D',high), todayLow = request.security(sym,'D',low)
    kicker = yestClose < yestOpen and todayOpen > yestOpen
    oel = todayOpen == todayLow, oeh = todayOpen == todayHigh
    oopsUp = todayOpen < yestLow and todayClose >= yestLow
    oopsDown = todayOpen > yestHigh and todayClose <= yestHigh
    inside = todayHigh <= yestHigh and todayLow >= yestLow
    engulf = todayHigh > yestHigh and todayLow < yestLow
    bull = todayClose > yestClose
    [kicker, oel, oeh, oopsUp, oopsDown, inside, engulf, bull]

    
//get the data for symbols
[kicker1, oel1, oeh1, oopsUp1, oopsDown1, inside1, engulf1, bull1] = sym1.data()
[kicker2, oel2, oeh2, oopsUp2, oopsDown2, inside2, engulf2, bull2] = sym2.data()
[kicker3, oel3, oeh3, oopsUp3, oopsDown3, inside3, engulf3, bull3] = sym3.data()
[kicker4, oel4, oeh4, oopsUp4, oopsDown4, inside4, engulf4, bull4] = sym4.data()
[kicker5, oel5, oeh5, oopsUp5, oopsDown5, inside5, engulf5, bull5] = sym5.data()


// plot the table
if barstate.islast and showTable and not doubleTable and not thirdTable
//headers
    table.cell(screener, 0, 0, 'Symbol', text_color = tableHeaderColor, text_size = tableTextSize.textsize(), width = 5, bgcolor = tableBgColor)
    if kickerBool
        table.cell(screener, 1, 0, 'Kicker', text_color = tableHeaderColor, text_size = tableTextSize.textsize(), width = 5, bgcolor = tableBgColor)
    if oopsBool
        table.cell(screener, 2, 0, 'Oops', text_color = tableHeaderColor, text_size = tableTextSize.textsize(), width = 5, bgcolor = tableBgColor)
    if oelBool
        table.cell(screener, 3, 0, 'OEL/OEH', text_color = tableHeaderColor, text_size = tableTextSize.textsize(), width = 5, bgcolor = tableBgColor)
    if insideBool
        table.cell(screener, 4, 0, 'IN/EN', text_color = tableHeaderColor, text_size = tableTextSize.textsize(), width = 5, bgcolor = tableBgColor)

// symbols
    table.cell(screener, 0, 1, str.tostring(sym1.splitter()), text_color = tableHeaderColor, text_size = tableTextSize.textsize(), bgcolor = tableBgColor)
    table.cell(screener, 0, 2, str.tostring(sym2.splitter()), text_color = tableHeaderColor, text_size = tableTextSize.textsize(), bgcolor = tableBgColor)
    table.cell(screener, 0, 3, str.tostring(sym3.splitter()), text_color = tableHeaderColor, text_size = tableTextSize.textsize(), bgcolor = tableBgColor)
    table.cell(screener, 0, 4, str.tostring(sym4.splitter()), text_color = tableHeaderColor, text_size = tableTextSize.textsize(), bgcolor = tableBgColor)
    table.cell(screener, 0, 5, str.tostring(sym5.splitter()), text_color = tableHeaderColor, text_size = tableTextSize.textsize(), bgcolor = tableBgColor)

//candlestick combos
    if kickerBool
        table.cell(screener, 1, 1, kicker1 ? 'Kicker' : na, bgcolor = kicker1 ? bullColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 1, 2, kicker2 ? 'Kicker' : na, bgcolor = kicker2 ? bullColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 1, 3, kicker3 ? 'Kicker' : na, bgcolor = kicker3 ? bullColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 1, 4, kicker4 ? 'Kicker' : na, bgcolor = kicker4 ? bullColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 1, 5, kicker5 ? 'Kicker' : na, bgcolor = kicker5 ? bullColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
    if oopsBool
        table.cell(screener, 2, 1, oopsUp1 ? 'Oops' : oopsDown1 ? 'Oops' : na, bgcolor = oopsUp1 ? bullColor : oopsDown1 ? bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 2, 2, oopsUp2 ? 'Oops' : oopsDown2 ? 'Oops' : na, bgcolor = oopsUp2 ? bullColor : oopsDown2 ? bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 2, 3, oopsUp3 ? 'Oops' : oopsDown3 ? 'Oops' : na, bgcolor = oopsUp3 ? bullColor : oopsDown3 ? bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 2, 4, oopsUp4 ? 'Oops' : oopsDown4 ? 'Oops' : na, bgcolor = oopsUp4 ? bullColor : oopsDown4 ? bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 2, 5, oopsUp5 ? 'Oops' : oopsDown5 ? 'Oops' : na, bgcolor = oopsUp5 ? bullColor : oopsDown5 ? bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
    if oelBool
        table.cell(screener, 3, 1, oel1 ? 'OEL' : oeh1 ? 'OEH' : na, bgcolor = oel1 ? bullColor : oeh1 ? bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 3, 2, oel2 ? 'OEL' : oeh2 ? 'OEH' : na, bgcolor = oel2 ? bullColor : oeh2 ? bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 3, 3, oel3 ? 'OEL' : oeh3 ? 'OEH' : na, bgcolor = oel3 ? bullColor : oeh3 ? bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 3, 4, oel4 ? 'OEL' : oeh4 ? 'OEH' : na, bgcolor = oel4 ? bullColor : oeh4 ? bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 3, 5, oel5 ? 'OEL' : oeh5 ? 'OEH' : na, bgcolor = oel5 ? bullColor : oeh5 ? bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
    if insideBool
        table.cell(screener, 4, 1, inside1 ? 'Inside' : engulf1 ? 'Engulfing' : na, bgcolor = inside1 ? bullColor : engulf1 ? bull1 ? bullColor : bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 4, 2, inside2 ? 'Inside' : engulf2 ? 'Engulfing' : na, bgcolor = inside2 ? bullColor : engulf2 ? bull2 ? bullColor : bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 4, 3, inside3 ? 'Inside' : engulf3 ? 'Engulfing' : na, bgcolor = inside3 ? bullColor : engulf3 ? bull3 ? bullColor : bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 4, 4, inside4 ? 'Inside' : engulf4 ? 'Engulfing' : na, bgcolor = inside4 ? bullColor : engulf4 ? bull4 ? bullColor : bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 4, 5, inside5 ? 'Inside' : engulf5 ? 'Engulfing' : na, bgcolor = inside5 ? bullColor : engulf5 ? bull5 ? bullColor : bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())

//second instance
if barstate.islast and (showTable and doubleTable and i_tableypos == 'Top') or (showTable and doubleTable and i_tableypos == 'Top' and thirdTable)
    table.cell(screener, 0, 0, ' ', width = 5), table.cell(screener, 1, 0, ' ', width = 5), table.cell(screener, 2, 0, ' ', width = 5), table.cell(screener, 3, 0, ' ', width = 5), table.cell(screener, 4, 0, ' ', width = 5)
    table.cell(screener, 0, 1, ' ', width = 5), table.cell(screener, 1, 1, ' ', width = 5), table.cell(screener, 2, 1, ' ', width = 5), table.cell(screener, 3, 1, ' ', width = 5), table.cell(screener, 4, 1, ' ', width = 5)
    table.cell(screener, 0, 2, ' ', width = 5), table.cell(screener, 1, 2, ' ', width = 5), table.cell(screener, 2, 2, ' ', width = 5), table.cell(screener, 3, 2, ' ', width = 5), table.cell(screener, 4, 2, ' ', width = 5)
    table.cell(screener, 0, 3, ' ', width = 5), table.cell(screener, 1, 3, ' ', width = 5), table.cell(screener, 2, 3, ' ', width = 5), table.cell(screener, 3, 3, ' ', width = 5), table.cell(screener, 4, 3, ' ', width = 5)
    table.cell(screener, 0, 4, ' ', width = 5), table.cell(screener, 1, 4, ' ', width = 5), table.cell(screener, 2, 4, ' ', width = 5), table.cell(screener, 3, 4, ' ', width = 5), table.cell(screener, 4, 4, ' ', width = 5)
    table.cell(screener, 0, 5, ' ', width = 5), table.cell(screener, 1, 5, ' ', width = 5), table.cell(screener, 2, 5, ' ', width = 5), table.cell(screener, 3, 5, ' ', width = 5), table.cell(screener, 4, 5, ' ', width = 5)

// symbols
    table.cell(screener, 0, 6, str.tostring(sym1.splitter()), text_color = tableHeaderColor, text_size = tableTextSize.textsize(), bgcolor = tableBgColor)
    table.cell(screener, 0, 7, str.tostring(sym2.splitter()), text_color = tableHeaderColor, text_size = tableTextSize.textsize(), bgcolor = tableBgColor)
    table.cell(screener, 0, 8, str.tostring(sym3.splitter()), text_color = tableHeaderColor, text_size = tableTextSize.textsize(), bgcolor = tableBgColor)
    table.cell(screener, 0, 9, str.tostring(sym4.splitter()), text_color = tableHeaderColor, text_size = tableTextSize.textsize(), bgcolor = tableBgColor)
    table.cell(screener, 0, 10, str.tostring(sym5.splitter()), text_color = tableHeaderColor, text_size = tableTextSize.textsize(), bgcolor = tableBgColor)

//candlestick combos
    if kickerBool 
        table.cell(screener, 1, 6, kicker1 ? 'Kicker' : na, bgcolor = kicker1 ? bullColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 1, 7, kicker2 ? 'Kicker' : na, bgcolor = kicker2 ? bullColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 1, 8, kicker3 ? 'Kicker' : na, bgcolor = kicker3 ? bullColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 1, 9, kicker4 ? 'Kicker' : na, bgcolor = kicker4 ? bullColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 1, 10, kicker5 ? 'Kicker' : na, bgcolor = kicker5 ? bullColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
    if oopsBool
        table.cell(screener, 2, 6, oopsUp1 ? 'Oops' : oopsDown1 ? 'Oops' : na, bgcolor = oopsUp1 ? bullColor : oopsDown1 ? bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 2, 7, oopsUp2 ? 'Oops' : oopsDown2 ? 'Oops' : na, bgcolor = oopsUp2 ? bullColor : oopsDown2 ? bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 2, 8, oopsUp3 ? 'Oops' : oopsDown3 ? 'Oops' : na, bgcolor = oopsUp3 ? bullColor : oopsDown3 ? bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 2, 9, oopsUp4 ? 'Oops' : oopsDown4 ? 'Oops' : na, bgcolor = oopsUp4 ? bullColor : oopsDown4 ? bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 2, 10, oopsUp5 ? 'Oops' : oopsDown5 ? 'Oops' : na, bgcolor = oopsUp5 ? bullColor : oopsDown5 ? bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
    if oelBool
        table.cell(screener, 3, 6, oel1 ? 'OEL' : oeh1 ? 'OEH' : na, bgcolor = oel1 ? bullColor : oeh1 ? bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 3, 7, oel2 ? 'OEL' : oeh2 ? 'OEH' : na, bgcolor = oel2 ? bullColor : oeh2 ? bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 3, 8, oel3 ? 'OEL' : oeh3 ? 'OEH' : na, bgcolor = oel3 ? bullColor : oeh3 ? bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 3, 9, oel4 ? 'OEL' : oeh4 ? 'OEH' : na, bgcolor = oel4 ? bullColor : oeh4 ? bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 3, 10, oel5 ? 'OEL' : oeh5 ? 'OEH' : na, bgcolor = oel5 ? bullColor : oeh5 ? bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
    if insideBool
        table.cell(screener, 4, 6, inside1 ? 'Inside' : engulf1 ? 'Engulfing' : na, bgcolor = inside1 ? bullColor : engulf1 ? bull1 ? bullColor : bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 4, 7, inside2 ? 'Inside' : engulf2 ? 'Engulfing' : na, bgcolor = inside2 ? bullColor : engulf2 ? bull2 ? bullColor : bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 4, 8, inside3 ? 'Inside' : engulf3 ? 'Engulfing' : na, bgcolor = inside3 ? bullColor : engulf3 ? bull3 ? bullColor : bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 4, 9, inside4 ? 'Inside' : engulf4 ? 'Engulfing' : na, bgcolor = inside4 ? bullColor : engulf4 ? bull4 ? bullColor : bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 4, 10, inside5 ? 'Inside' : engulf5 ? 'Engulfing' : na, bgcolor = inside5 ? bullColor : engulf5 ? bull5 ? bullColor : bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())

//third instance
if barstate.islast and (showTable and thirdTable and i_tableypos == 'Top') or (showTable and thirdTable and i_tableypos == 'Top' and doubleTable)
    table.cell(screener, 0, 0, ' ', width = 5), table.cell(screener, 1, 0, ' ', width = 5), table.cell(screener, 2, 0, ' ', width = 5), table.cell(screener, 3, 0, ' ', width = 5), table.cell(screener, 4, 0, ' ', width = 5)
    table.cell(screener, 0, 1, ' ', width = 5), table.cell(screener, 1, 1, ' ', width = 5), table.cell(screener, 2, 1, ' ', width = 5), table.cell(screener, 3, 1, ' ', width = 5), table.cell(screener, 4, 1, ' ', width = 5)
    table.cell(screener, 0, 2, ' ', width = 5), table.cell(screener, 1, 2, ' ', width = 5), table.cell(screener, 2, 2, ' ', width = 5), table.cell(screener, 3, 2, ' ', width = 5), table.cell(screener, 4, 2, ' ', width = 5)
    table.cell(screener, 0, 3, ' ', width = 5), table.cell(screener, 1, 3, ' ', width = 5), table.cell(screener, 2, 3, ' ', width = 5), table.cell(screener, 3, 3, ' ', width = 5), table.cell(screener, 4, 3, ' ', width = 5)
    table.cell(screener, 0, 4, ' ', width = 5), table.cell(screener, 1, 4, ' ', width = 5), table.cell(screener, 2, 4, ' ', width = 5), table.cell(screener, 3, 4, ' ', width = 5), table.cell(screener, 4, 4, ' ', width = 5)
    table.cell(screener, 0, 5, ' ', width = 5), table.cell(screener, 1, 5, ' ', width = 5), table.cell(screener, 2, 5, ' ', width = 5), table.cell(screener, 3, 5, ' ', width = 5), table.cell(screener, 4, 5, ' ', width = 5)
    table.cell(screener, 0, 6, ' ', width = 5), table.cell(screener, 1, 6, ' ', width = 5), table.cell(screener, 2, 6, ' ', width = 5), table.cell(screener, 3, 6, ' ', width = 5), table.cell(screener, 4, 6, ' ', width = 5)
    table.cell(screener, 0, 7, ' ', width = 5), table.cell(screener, 1, 7, ' ', width = 5), table.cell(screener, 2, 7, ' ', width = 5), table.cell(screener, 3, 7, ' ', width = 5), table.cell(screener, 4, 7, ' ', width = 5)
    table.cell(screener, 0, 8, ' ', width = 5), table.cell(screener, 1, 8, ' ', width = 5), table.cell(screener, 2, 8, ' ', width = 5), table.cell(screener, 3, 8, ' ', width = 5), table.cell(screener, 4, 8, ' ', width = 5)
    table.cell(screener, 0, 9, ' ', width = 5), table.cell(screener, 1, 9, ' ', width = 5), table.cell(screener, 2, 9, ' ', width = 5), table.cell(screener, 3, 9, ' ', width = 5), table.cell(screener, 4, 9, ' ', width = 5)
    table.cell(screener, 0, 10, ' ', width = 5), table.cell(screener, 1, 10, ' ', width = 5), table.cell(screener, 2, 10, ' ', width = 5), table.cell(screener, 3, 10, ' ', width = 5), table.cell(screener, 4, 10, ' ', width = 5)
    


// symbols
    table.cell(screener, 0, 11, str.tostring(sym1.splitter()), text_color = tableHeaderColor, text_size = tableTextSize.textsize(), bgcolor = tableBgColor)
    table.cell(screener, 0, 12, str.tostring(sym2.splitter()), text_color = tableHeaderColor, text_size = tableTextSize.textsize(), bgcolor = tableBgColor)
    table.cell(screener, 0, 13, str.tostring(sym3.splitter()), text_color = tableHeaderColor, text_size = tableTextSize.textsize(), bgcolor = tableBgColor)
    table.cell(screener, 0, 14, str.tostring(sym4.splitter()), text_color = tableHeaderColor, text_size = tableTextSize.textsize(), bgcolor = tableBgColor)
    table.cell(screener, 0, 15, str.tostring(sym5.splitter()), text_color = tableHeaderColor, text_size = tableTextSize.textsize(), bgcolor = tableBgColor)

//candlestick combos
    if kickerBool 
        table.cell(screener, 1, 11, kicker1 ? 'Kicker' : na, bgcolor = kicker1 ? bullColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 1, 12, kicker2 ? 'Kicker' : na, bgcolor = kicker2 ? bullColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 1, 13, kicker3 ? 'Kicker' : na, bgcolor = kicker3 ? bullColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 1, 14, kicker4 ? 'Kicker' : na, bgcolor = kicker4 ? bullColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 1, 15, kicker5 ? 'Kicker' : na, bgcolor = kicker5 ? bullColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
    if oopsBool
        table.cell(screener, 2, 11, oopsUp1 ? 'Oops' : oopsDown1 ? 'Oops' : na, bgcolor = oopsUp1 ? bullColor : oopsDown1 ? bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 2, 12, oopsUp2 ? 'Oops' : oopsDown2 ? 'Oops' : na, bgcolor = oopsUp2 ? bullColor : oopsDown2 ? bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 2, 13, oopsUp3 ? 'Oops' : oopsDown3 ? 'Oops' : na, bgcolor = oopsUp3 ? bullColor : oopsDown3 ? bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 2, 14, oopsUp4 ? 'Oops' : oopsDown4 ? 'Oops' : na, bgcolor = oopsUp4 ? bullColor : oopsDown4 ? bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 2, 15, oopsUp5 ? 'Oops' : oopsDown5 ? 'Oops' : na, bgcolor = oopsUp5 ? bullColor : oopsDown5 ? bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
    if oelBool
        table.cell(screener, 3, 11, oel1 ? 'OEL' : oeh1 ? 'OEH' : na, bgcolor = oel1 ? bullColor : oeh1 ? bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 3, 12, oel2 ? 'OEL' : oeh2 ? 'OEH' : na, bgcolor = oel2 ? bullColor : oeh2 ? bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 3, 13, oel3 ? 'OEL' : oeh3 ? 'OEH' : na, bgcolor = oel3 ? bullColor : oeh3 ? bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 3, 14, oel4 ? 'OEL' : oeh4 ? 'OEH' : na, bgcolor = oel4 ? bullColor : oeh4 ? bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 3, 15, oel5 ? 'OEL' : oeh5 ? 'OEH' : na, bgcolor = oel5 ? bullColor : oeh5 ? bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
    if insideBool
        table.cell(screener, 4, 11, inside1 ? 'Inside' : engulf1 ? 'Engulfing' : na, bgcolor = inside1 ? bullColor : engulf1 ? bull1 ? bullColor : bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 4, 12, inside2 ? 'Inside' : engulf2 ? 'Engulfing' : na, bgcolor = inside2 ? bullColor : engulf2 ? bull2 ? bullColor : bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 4, 13, inside3 ? 'Inside' : engulf3 ? 'Engulfing' : na, bgcolor = inside3 ? bullColor : engulf3 ? bull3 ? bullColor : bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 4, 14, inside4 ? 'Inside' : engulf4 ? 'Engulfing' : na, bgcolor = inside4 ? bullColor : engulf4 ? bull4 ? bullColor : bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())
        table.cell(screener, 4, 15, inside5 ? 'Inside' : engulf5 ? 'Engulfing' : na, bgcolor = inside5 ? bullColor : engulf5 ? bull5 ? bullColor : bearColor : tableBgColor, text_color = tableTextColor, text_size = tableTextSize.textsize())