Stoch RSI 15 min - multi time frame table
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © TaTaTaCrypto
//@version=5

indicator("Stoch RSI",overlay = true)

lengthRSI = input.int(14, "Length RSI")
lengthMovingAverage = input.int(3, "Length Moving Average")

rsi_curr = ta.rsi(close, lengthRSI)
stochRSI = ta.stoch(rsi_curr,rsi_curr,rsi_curr, lengthRSI)
stochRSI_smoth = ta.sma(stochRSI, lengthMovingAverage)

//T15_RSI_Ticker_R = 

T15_RSI_TickerR = request.security(syminfo.tickerid ,timeframe.period   ,stochRSI_smoth)
T15_RSI_Ticker  = request.security(syminfo.tickerid ,timeframe.period   ,stochRSI_smoth[barstate.isrealtime ? 1:0])
//T15_RSI_BTC     = request.security("BTCUSDT"        ,timeframe.period   ,stochRSI_smoth[barstate.isrealtime ? 1:0])
//T15_RSI_ETH     = request.security("ETHUSDT"        ,timeframe.period   ,stochRSI_smoth[barstate.isrealtime ? 1:0])
T30_RSI_Ticker  = request.security(syminfo.tickerid ,"30"               ,stochRSI_smoth[barstate.isrealtime ? 1:0])
T60_RSI_Ticker  = request.security(syminfo.tickerid ,"60"               ,stochRSI_smoth[barstate.isrealtime ? 1:0])
T4h_RSI_Ticker  = request.security(syminfo.tickerid ,"240"              ,stochRSI_smoth[barstate.isrealtime ? 1:0])
T12h_RSI_Ticker = request.security(syminfo.tickerid ,"720"             ,stochRSI_smoth[barstate.isrealtime ? 1:0])

table panel = table.new(position.top_right, 2, 7,frame_width=1, border_width=1, border_color=color.new(color.white, 100))
if barstate.islast
    // Populate the table on the last bar
    table.cell(panel, 0, 0,  "Stoch MA" + "3" + " l"+"14", bgcolor =color.white)
    table.cell(panel, 0, 1, "15minR", bgcolor = color.white)
    table.cell(panel, 0, 2, "15min", bgcolor = color.white)
    table.cell(panel, 0, 3, "30min", bgcolor =color.white)
    table.cell(panel, 0, 4, "1h",  bgcolor = color.white)
    table.cell(panel, 0, 5, "4h",  bgcolor = color.white)
    table.cell(panel, 0, 6, "12h",  bgcolor = color.white)
    table.cell(panel, 1, 1, str.tostring(T15_RSI_TickerR,'#.#'), bgcolor = #fcfcfc)
    table.cell(panel, 1, 2, str.tostring(T15_RSI_Ticker,'#.#'), bgcolor = #fcfcfc)
    table.cell(panel, 1, 3, str.tostring(T30_RSI_Ticker,'#.#'),  bgcolor = #fcfcfc)
    table.cell(panel, 1, 4, str.tostring(T60_RSI_Ticker,'#.#'),  bgcolor = #fcfcfc)
    table.cell(panel, 1, 5, str.tostring(T4h_RSI_Ticker,'#.#'),  bgcolor = #fcfcfc)
    table.cell(panel, 1, 6, str.tostring(T12h_RSI_Ticker,'#.#'),  bgcolor = #fcfcfc)
    table.merge_cells(panel,0,0,1,0) 
    //table.merge_cells(panel,0,0,1,0) 
