Internals
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © TraderCreatorPro

//@version=5
indicator("Internals", overlay = true)
//inputs

normalcolor = input.color (color.gray) // the color if it is under the certain percentage
colorchange = input.color(color.white) //the color it will change to if... 
percolor = input.int(100)// the percerntage the color will change with
BoxPlacement = input.string(position.bottom_right, "Box Placement", options = [position.bottom_right, position.bottom_left, position.top_right, position.top_center, position.bottom_center])
ShowPcall = input.bool(true, "Put to Call Ratio")
ShowADD = input.bool (true, "Advance Decline")
ShowTick = input.bool (true, "Tick Mark")
ShowVix = input.bool (true, "VIX")


//Prepare a table
var table myTable = table.new(BoxPlacement, 1, 4, bgcolor = normalcolor, border_color = color.black, border_width = 2)

//Indicator math stuff
PCALL = math.round(request.security("PC", "1", close),2)
TICK = math.round(request.security("TICK", "1", close),2)
ADD = request.security("ADD", "1", close)
VIX = request.security("VIX", "1", close)



//Draw Table
if barstate.islast
    table.cell(myTable, 0,0, text = "PCALL: " + str.tostring(PCALL), text_color = ShowPcall? color.white: na, bgcolor =  PCALL > 1? color.red :ShowPcall? color.gray: na)
    table.cell(myTable, 0,1, text = "TICK: " + str.tostring(TICK), text_color = ShowTick? color.white:na, bgcolor = ShowTick and TICK > 900? color.green : ShowTick and TICK <-900? color.red :ShowTick? color.gray:  na)
    table.cell(myTable, 0,2, text = "ADD: " + str.tostring(ADD), text_color = ShowADD? color.white: na, bgcolor = ShowADD and ADD < -2000 ? color.red: ShowADD and ADD > 2000 ? color.green: ShowADD? color.gray: na)
    table.cell(myTable, 0,3, text = "VIX: " + str.tostring(VIX), text_color = ShowVix? color.white: na, bgcolor = ShowVix? color.gray:na)
plot(na)
