Show-Bias
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © amitni82

//@version=5
indicator("Show-Bias-v2", overlay = true, max_bars_back = 5)

// Inputs
// highlightBar  = input.bool(true, "Highlight current bar")
highlighterColorBullish = input.color(color.new(color.lime, 75), "Highlighter Color for Bullish bias", group = "formatting")
highlighterColorBearish = input.color(color.new(color.orange, 75), "Highlighter Color for Bearish bias", group = "formatting")

// Bullish Bearish
var infotbl = table.new(position.top_right, 1, 1, border_color = color.white, border_width = 1)

color highlighterColor = na
if barstate.islast
    if close > open and high > high[1] and low > low[1] and close > high[1]
        highlighterColor := highlighterColorBullish
        table.cell(infotbl, 0, 0, "Bull HH + HL + HC", text_color = color.white, bgcolor = color.green, width = 15, text_size = size.normal)
    else
        if close < open and high < high[1] and low < low[1] and close < low[1]
            highlighterColor := highlighterColorBearish  
            table.cell(infotbl, 0, 0, "Bear LH + LL + LC", text_color = color.white, bgcolor = color.orange, width = 15, text_size = size.normal)
        else
            table.cell(infotbl, 0, 0, "No bias", text_color = color.white, bgcolor = color.gray, width = 15, text_size = size.normal)

//bgcolor(barstate.islast ? highlighterColor : na, editable = false)
