In Chart Currency Tickers
// This source code is subject to the terms of the Mozilla Public LiceFXCM 2.0 at https://mozilla.org/MPL/2.0/
// © hjsjshs//ASIF KERIM NADUVILAPARAMBIL//

//@version=5
indicator(title='Currency Tickers', shorttitle='In Chart Currency Tickers', overlay=true)

getCloses() =>
    [close, close[1]]

getArrow(bIsUp) =>
    bIsUp ? ' ⯅' : ' ⯆'

getSign(bIsUp) =>
    bIsUp ? '[+' : '['

getColor(bIsUp) =>
    bIsUp ? #00EE00 : #EE0000

index_0 = input.symbol('XAUUSD', 'Currency #1')
index_1 = input.symbol('EURUSD', 'Currency #2')
index_2 = input.symbol('GBPUSD', 'Currency #3')
index_3 = input.symbol('USDCHF', 'Currency #4')
index_4 = input.symbol('USDJPY', 'Currency #5')
index_5 = input.symbol('USDCNH', 'Currency #6')
index_6 = input.symbol('USDRUB', 'Currency #7')
index_7 = input.symbol('AUDUSD', 'Currency #8')
index_8 = input.symbol('USDNZD', 'Currency #9')
index_9 = input.symbol('USDCAD', 'Currency #10')
index_10 = input.symbol('GBPCHF', 'Currency #11')
index_11 = input.symbol('GBPJPY', 'Currency #12')
index_12 = input.symbol('AUDCAD', 'Currency #13')
index_13 = input.symbol('AUDCHF', 'Currency #14')
index_14 = input.symbol('AUDNZD', 'Currency #15')
var table logo = table.new(position.bottom_right, 1, 1)
if barstate.islast
    table.cell(logo, 0, 0, '|A|S|I|F||K|', text_size=size.normal, text_color=#0099FF,bgcolor=#00000080)



[close_0, lastClose_0] = request.security(index_0, 'D', getCloses(), barmerge.gaps_off, barmerge.lookahead_on)
[close_1, lastClose_1] = request.security(index_1, 'D', getCloses(), barmerge.gaps_off, barmerge.lookahead_on)
[close_2, lastClose_2] = request.security(index_2, 'D', getCloses(), barmerge.gaps_off, barmerge.lookahead_on)
[close_3, lastClose_3] = request.security(index_3, 'D', getCloses(), barmerge.gaps_off, barmerge.lookahead_on)
[close_4, lastClose_4] = request.security(index_4, 'D', getCloses(), barmerge.gaps_off, barmerge.lookahead_on)
[close_5, lastClose_5] = request.security(index_5, 'D', getCloses(), barmerge.gaps_off, barmerge.lookahead_on)
[close_6, lastClose_6] = request.security(index_6, 'D', getCloses(), barmerge.gaps_off, barmerge.lookahead_on)
[close_7, lastClose_7] = request.security(index_7, 'D', getCloses(), barmerge.gaps_off, barmerge.lookahead_on)
[close_8, lastClose_8] = request.security(index_8, 'D', getCloses(), barmerge.gaps_off, barmerge.lookahead_on)
[close_9, lastClose_9] = request.security(index_9, 'D', getCloses(), barmerge.gaps_off, barmerge.lookahead_on)
[close_10, lastClose_10] = request.security(index_10, 'D', getCloses(), barmerge.gaps_off, barmerge.lookahead_on)
[close_11, lastClose_11] = request.security(index_11, 'D', getCloses(), barmerge.gaps_off, barmerge.lookahead_on)
[close_12, lastClose_12] = request.security(index_12, 'D', getCloses(), barmerge.gaps_off, barmerge.lookahead_on)
[close_13, lastClose_13] = request.security(index_13, 'D', getCloses(), barmerge.gaps_off, barmerge.lookahead_on)
[close_14, lastClose_14] = request.security(index_14, 'D', getCloses(), barmerge.gaps_off, barmerge.lookahead_on)

if barstate.islast
    diff_0 = close_0 - lastClose_0
    perc_0 = ((close_0 - lastClose_0)/lastClose_0*100)
    isUp_0 = close_0 > lastClose_0
    arrow0 = getArrow(isUp_0)
    color0 = getColor(isUp_0)
    sign_0 = getSign(isUp_0)
    diff_1 = close_1 - lastClose_1
    perc_1 = ((close_1 - lastClose_1)/lastClose_1*100)
    isUp_1 = close_1 > lastClose_1
    arrow1 = getArrow(isUp_1)
    color1 = getColor(isUp_1)
    sign_1 = getSign(isUp_1)
    diff_2 = close_2 - lastClose_2
    perc_2 = ((close_2 - lastClose_2)/lastClose_2*100)
    isUp_2 = close_2 > lastClose_2
    arrow2 = getArrow(isUp_2)
    color2 = getColor(isUp_2)
    sign_2 = getSign(isUp_2)
    diff_3 = close_3 - lastClose_3
    perc_3 = ((close_3 - lastClose_3)/lastClose_3*100)
    isUp_3 = close_3 > lastClose_3
    arrow3 = getArrow(isUp_3)
    color3 = getColor(isUp_3)
    sign_3 = getSign(isUp_3)
    diff_4 = close_4 - lastClose_4
    perc_4 = ((close_4 - lastClose_4)/lastClose_4*100)
    isUp_4 = close_4 > lastClose_4
    arrow4 = getArrow(isUp_4)
    color4 = getColor(isUp_4)
    sign_4 = getSign(isUp_4)
    diff_5 = close_5 - lastClose_5
    perc_5 = ((close_5 - lastClose_5)/lastClose_5*100)
    isUp_5 = close_5 > lastClose_5
    arrow5 = getArrow(isUp_5)
    color5 = getColor(isUp_5)
    sign_5 = getSign(isUp_5)
    diff_6 = close_6 - lastClose_6
    perc_6 = ((close_6 - lastClose_6)/lastClose_6*100)
    isUp_6 = close_6 > lastClose_6
    arrow6 = getArrow(isUp_6)
    color6 = getColor(isUp_6)
    sign_6 = getSign(isUp_6)
    diff_7 = close_7 - lastClose_7
    perc_7 = ((close_7 - lastClose_7)/lastClose_7*100)
    isUp_7 = close_7 > lastClose_7
    arrow7 = getArrow(isUp_7)
    color7 = getColor(isUp_7)
    sign_7 = getSign(isUp_7)
    diff_8 = close_8 - lastClose_8
    perc_8 = ((close_8 - lastClose_8)/lastClose_8*100)
    isUp_8 = close_8 > lastClose_8
    arrow8 = getArrow(isUp_8)
    color8 = getColor(isUp_8)
    sign_8 = getSign(isUp_8)
    diff_9 = close_9 - lastClose_9
    perc_9 = ((close_9 - lastClose_9)/lastClose_9*100)
    isUp_9 = close_9 > lastClose_9
    arrow9 = getArrow(isUp_9)
    color9 = getColor(isUp_9)
    sign_9 = getSign(isUp_9)
    diff_10 = close_10 - lastClose_10
    perc_10 = ((close_10 - lastClose_10)/lastClose_10*100)
    isUp_10 = close_10 > lastClose_10
    arrow10 = getArrow(isUp_10)
    color10 = getColor(isUp_10)
    sign_10 = getSign(isUp_10)
    diff_11 = close_11 - lastClose_11
    perc_11 = ((close_11 - lastClose_11)/lastClose_11*100)
    isUp_11 = close_11 > lastClose_11
    arrow11 = getArrow(isUp_11)
    color11 = getColor(isUp_11)
    sign_11 = getSign(isUp_11)
    diff_12 = close_12 - lastClose_12
    perc_12 = ((close_12 - lastClose_12)/lastClose_12*100)
    isUp_12 = close_12 > lastClose_12
    arrow12 = getArrow(isUp_12)
    color12 = getColor(isUp_12)
    sign_12 = getSign(isUp_12)
    diff_13 = close_13 - lastClose_13
    perc_13 = ((close_13 - lastClose_13)/lastClose_13*100)
    isUp_13 = close_13 > lastClose_13
    arrow13 = getArrow(isUp_13)
    color13 = getColor(isUp_13)
    sign_13 = getSign(isUp_13)
    diff_14 = close_14 - lastClose_14
    perc_14 = ((close_14 - lastClose_14)/lastClose_14*100)
    isUp_14 = close_14 > lastClose_14
    arrow14 = getArrow(isUp_14)
    color14 = getColor(isUp_14)
    sign_14 = getSign(isUp_14)



    var tTickerTable = table.new(position.bottom_left, 4, 15, bgcolor=#00000080, frame_width=1, frame_color=color.black)
    table.cell(tTickerTable, 0, 0, index_0, text_color=#0099FF)
    table.cell(tTickerTable, 1, 0, str.tostring(close_0,"#######.######") + arrow0, text_color=color0, text_halign=text.align_right)
    table.cell(tTickerTable, 2, 0, sign_0 + str.tostring(diff_0,"#######.######")+ ']'+ '[' + str.tostring(perc_0,"###.##") + '%]', text_color=color0, text_halign=text.align_left)
    table.cell(tTickerTable, 0, 1, index_1, text_color=#0099FF)
    table.cell(tTickerTable, 1, 1, str.tostring(close_1,"#######.#####") + arrow1, text_color=color1, text_halign=text.align_right)
    table.cell(tTickerTable, 2, 1, sign_1 + str.tostring(diff_1,"#######.#####")+ ']'+ '[' + str.tostring(perc_1,"###.##") + '%]', text_color=color1, text_halign=text.align_left)
    table.cell(tTickerTable, 0, 2, index_2, text_color=#0099FF)
    table.cell(tTickerTable, 1, 2, str.tostring(close_2,"#######.#####") + arrow2, text_color=color2, text_halign=text.align_right)
    table.cell(tTickerTable, 2, 2, sign_2 + str.tostring(diff_2,"#######.#####")+ ']'+ '[' + str.tostring(perc_2,"###.##") + '%]', text_color=color2, text_halign=text.align_left)
    table.cell(tTickerTable, 0, 3, index_3, text_color=#0099FF)
    table.cell(tTickerTable, 1, 3, str.tostring(close_3,"#######.#####") + arrow3, text_color=color3, text_halign=text.align_right)
    table.cell(tTickerTable, 2, 3, sign_3 + str.tostring(diff_3,"#######.######")+ ']'+ '[' + str.tostring(perc_3,"###.##") + '%]', text_color=color3, text_halign=text.align_left)
    table.cell(tTickerTable, 0, 4, index_4, text_color=#0099FF)
    table.cell(tTickerTable, 1, 4, str.tostring(close_4,"#######.#####") + arrow4, text_color=color4, text_halign=text.align_right)
    table.cell(tTickerTable, 2, 4, sign_4 + str.tostring(diff_4,"#######.######")+ ']'+ '[' + str.tostring(perc_4,"###.##") + '%]', text_color=color4, text_halign=text.align_left)
    table.cell(tTickerTable, 0, 5, index_5, text_color=#0099FF)
    table.cell(tTickerTable, 1, 5, str.tostring(close_5,"#######.#####") + arrow5, text_color=color5, text_halign=text.align_right)
    table.cell(tTickerTable, 2, 5, sign_5 + str.tostring(diff_5,"#######.######")+ ']'+ '[' + str.tostring(perc_5,"###.##") + '%]', text_color=color5, text_halign=text.align_left)
    table.cell(tTickerTable, 0, 6, index_6, text_color=#0099FF)
    table.cell(tTickerTable, 1, 6, str.tostring(close_6,"#######.#####") + arrow6, text_color=color6, text_halign=text.align_right)
    table.cell(tTickerTable, 2, 6, sign_6 + str.tostring(diff_6,"#######.######")+ ']'+ '[' + str.tostring(perc_6,"###.##") + '%]', text_color=color6, text_halign=text.align_left)
    table.cell(tTickerTable, 0, 7, index_7, text_color=#0099FF)
    table.cell(tTickerTable, 1, 7, str.tostring(close_7,"#######.#####") + arrow7, text_color=color7, text_halign=text.align_right)
    table.cell(tTickerTable, 2, 7, sign_7 + str.tostring(diff_7,"#######.######")+ ']'+ '[' + str.tostring(perc_7,"###.##") + '%]', text_color=color7, text_halign=text.align_left)
    table.cell(tTickerTable, 0, 8, index_8, text_color=#0099FF)
    table.cell(tTickerTable, 1, 8, str.tostring(close_8,"#######.#####") + arrow8, text_color=color8, text_halign=text.align_right)
    table.cell(tTickerTable, 2, 8, sign_8 + str.tostring(diff_8,"#######.######")+ ']'+ '[' + str.tostring(perc_8,"###.##") + '%]', text_color=color8, text_halign=text.align_left)
    table.cell(tTickerTable, 0, 9, index_9, text_color=#0099FF)
    table.cell(tTickerTable, 1, 9, str.tostring(close_9,"#######.#####") + arrow9, text_color=color9, text_halign=text.align_right)
    table.cell(tTickerTable, 2, 9, sign_9 + str.tostring(diff_9,"#######.######")+ ']'+ '[' + str.tostring(perc_9,"###.##") + '%]', text_color=color9, text_halign=text.align_left)
    table.cell(tTickerTable, 0, 10, index_10, text_color=#0099FF)
    table.cell(tTickerTable, 1, 10, str.tostring(close_10,"#######.#####") + arrow10, text_color=color10, text_halign=text.align_right)
    table.cell(tTickerTable, 2, 10, sign_10 + str.tostring(diff_10,"#######.######")+ ']'+ '[' + str.tostring(perc_10,"###.##") + '%]', text_color=color10, text_halign=text.align_left)
    table.cell(tTickerTable, 0, 11, index_11, text_color=#0099FF)
    table.cell(tTickerTable, 1, 11, str.tostring(close_11,"#######.#####") + arrow11, text_color=color11, text_halign=text.align_right)
    table.cell(tTickerTable, 2, 11, sign_11 + str.tostring(diff_11,"#######.######")+ ']'+ '[' + str.tostring(perc_11,"###.##") + '%]', text_color=color11, text_halign=text.align_left)
    table.cell(tTickerTable, 0, 12, index_12, text_color=#0099FF)
    table.cell(tTickerTable, 1, 12, str.tostring(close_12,"#######.#####") + arrow12, text_color=color12, text_halign=text.align_right)
    table.cell(tTickerTable, 2, 12, sign_12 + str.tostring(diff_12,"#######.######")+ ']'+ '[' + str.tostring(perc_12,"###.##") + '%]', text_color=color12, text_halign=text.align_left)
    table.cell(tTickerTable, 0, 13, index_13, text_color=#0099FF)
    table.cell(tTickerTable, 1, 13, str.tostring(close_13,"#######.#####") + arrow13, text_color=color13, text_halign=text.align_right)
    table.cell(tTickerTable, 2, 13, sign_13 + str.tostring(diff_13,"#######.######")+ ']'+ '[' + str.tostring(perc_13,"###.##") + '%]', text_color=color13, text_halign=text.align_left)
    table.cell(tTickerTable, 0, 14, index_14, text_color=#0099FF)
    table.cell(tTickerTable, 1, 14, str.tostring(close_14,"#######.#####") + arrow14, text_color=color14, text_halign=text.align_right)
    table.cell(tTickerTable, 2, 14, sign_14 + str.tostring(diff_14,"#######.######")+ ']'+ '[' + str.tostring(perc_14,"###.##") + '%]', text_color=color14, text_halign=text.align_left)


