All Central Bank Interest Rates
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © greenmask9
//@version=4
study(title = "All Central Bank Interest Rates", shorttitle = "CB Rates+", overlay=true, precision = 3)

////////////

last_update = input(true, "Last Indicator Update - 15.05.2022")

i_position = input(type = input.string, title = "Table Placement", defval = "Middle Right", 
 options = ["Top Right", "Middle Right", "Bottom Right", "Middle Center"])
i_two_historical = input(true, "Activate Two Historical Values")
i_table_width = input(title = "Text", defval = 8)
i_table_height = input(title = "Text", defval = 5)

ic_text = input(type = input.color, title = "Text", defval = color.new(color.yellow, 0))
ic_table = input(type = input.color, title = "Background", defval = color.new(color.gray, 70))


position = i_position == "Top Right" ? position.top_right : i_position == "Middle Right" ? position.middle_right : i_position == "Bottom Right" ? position.bottom_right : position.middle_center

var table perfTable = table.new(position, 3, 8, border_width = 1)

width = i_table_width
height = i_table_height

table.cell(perfTable, 0, 0, text = "USD: 3.500 \n ↑ 15.12.22", bgcolor = ic_table, text_color = ic_text, width = width, height = height)
table.cell(perfTable, 0, 1, text = "CAD: 4.250 \n ↑ 07.12.22", bgcolor = ic_table, text_color = ic_text, width = width, height = height)
table.cell(perfTable, 0, 2, text = "EUR: 2.500 \n - 15.12.22", bgcolor = ic_table, text_color = ic_text, width = width, height = height)
table.cell(perfTable, 0, 3, text = "GBP: 3.500 \n ↑ 15.12.22", bgcolor = ic_table, text_color = ic_text, width = width, height = height)
table.cell(perfTable, 0, 4, text = "CHF: 1.000 \n - 15.12.22", bgcolor = ic_table, text_color = ic_text, width = width, height = height)
table.cell(perfTable, 0, 5, text = "AUD: 3.100 \n ↑ 06.12.22", bgcolor = ic_table, text_color = ic_text, width = width, height = height)
table.cell(perfTable, 0, 6, text = "NZD: 4.250 \n ↑ 23.11.22", bgcolor = ic_table, text_color = ic_text, width = width, height = height)
table.cell(perfTable, 0, 7, text = "JPY: -0.10 \n - 01.01.16", bgcolor = ic_table, text_color = ic_text, width = width, height = height)

//if i_two_historical
//    table.cell(perfTable, 1, 0, text = "USD: 1.000 \n ↑ 04.05.22", bgcolor = ic_table, text_color = ic_text, width = width, height = height)
//    table.cell(perfTable, 1, 1, text = "CAD: 1.000 \n ↑ 13.04.22", bgcolor = ic_table, text_color = ic_text, width = width, height = height)
//    table.cell(perfTable, 1, 2, text = "EUR: 0.050 \n - 04.09.14", bgcolor = ic_table, text_color = ic_text, width = width, height = height)
//    table.cell(perfTable, 1, 3, text = "GBP: 1.000 \n ↑ 05.05.22", bgcolor = ic_table, text_color = ic_text, width = width, height = height)
//    table.cell(perfTable, 1, 4, text = "CHF: -0.75 \n - 15.01.15", bgcolor = ic_table, text_color = ic_text, width = width, height = height)
//    table.cell(perfTable, 1, 5, text = "AUD: 0.350 \n ↑ 03.05.22", bgcolor = ic_table, text_color = ic_text, width = width, height = height)
//    table.cell(perfTable, 1, 6, text = "NZD: 1.500 \n ↑ 13.04.22", bgcolor = ic_table, text_color = ic_text, width = width, height = height)
//    table.cell(perfTable, 1, 7, text = "JPY: 0.000 \n - 05.10.10", bgcolor = ic_table, text_color = ic_text, width = width, height = height)
//    
//    table.cell(perfTable, 2, 0, text = "USD: 0.500 \n ↑ 16.03.22", bgcolor = ic_table, text_color = ic_text, width = width, height = height)
//    table.cell(perfTable, 2, 1, text = "CAD: 0.500 \n ↑ 02.03.22", bgcolor = ic_table, text_color = ic_text, width = width, height = height)
//    table.cell(perfTable, 2, 2, text = "EUR: 0.150 \n - 05.07.14", bgcolor = ic_table, text_color = ic_text, width = width, height = height)
//    table.cell(perfTable, 2, 3, text = "GBP: 0.750 \n ↑ 16.03.22", bgcolor = ic_table, text_color = ic_text, width = width, height = height)
//    table.cell(perfTable, 2, 4, text = "CHF: -0.50 \n - 18.12.14", bgcolor = ic_table, text_color = ic_text, width = width, height = height)
//    table.cell(perfTable, 2, 5, text = "AUD: 0.100 \n - 03.11.20", bgcolor = ic_table, text_color = ic_text, width = width, height = height)
//    table.cell(perfTable, 2, 6, text = "NZD: 1.000 \n ↑ 22.02.22", bgcolor = ic_table, text_color = ic_text, width = width, height = height)
//    table.cell(perfTable, 2, 7, text = "JPY: 0.100 \n - 19.12.08", bgcolor = ic_table, text_color = ic_text, width = width, height = height)

