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

//@version=5
indicator(title="Ticker", overlay=true)

// On the last historical bar, make a label that shows the
// instrument's symbol and exchange.
var textbox = table.new(position = position.top_left, columns = 2, rows = 3)

// Color Customization
textlight = input.color(color.new(#FFFFFF, 0), title="Text Color")
textdark = input.color(color.new(#333333, 0), title="Subtext Color")
cellbg = input.color(color.new(#ffbb3d, 0), title="Subtext Color")

// Ticker Customization
ticker = str.replace_all(syminfo.ticker, "USD", "")


// Symbol Customization
symbol = syminfo.description

arr = array.new_string(0)
array.push(arr, " / United States Dollar")
array.push(arr, " / U.S. Dollar")
array.push(arr, " / U. S. Dollar")
array.push(arr, " / U.S. dollar")
array.push(arr, " / US Dollar")
array.push(arr, " all time history index")
array.push(arr, " (calculated by TradingView)")
array.push(arr, " (CALCULATED BY TRADINGVIEW)")
array.push(arr, " (CONTINUOUS: CURRENT CONTRACT IN FRONT)")
array.push(arr, " INDUSTRIAL AVERAGE")

for i = 0 to array.size(arr) - 1
    symbol := str.replace_all(symbol, str.tostring(array.get(arr, i)), "")


if barstate.islast
    table.cell(table_id = textbox, column = 0, row = 0, text_size=size.tiny, width = 3, height = 5)
    table.cell(table_id = textbox, column = 1, row = 1, text_size=size.huge, text = ticker, text_color = textlight)
    table.cell(table_id = textbox, column = 1, row = 2, text_size=size.small, text = symbol, text_color = textdark, bgcolor = cellbg)

