"//@version=5
indicator("20.1) Refined Flower and Fire tbl Multi-Time Frame", overlay=true, max_bars_back=500)

// Function to compute 'Flower' condition
flower_condition_tf() =>
    rsi9 = ta.rsi(close, 9)
    ema20_high = ta.ema(high, 20)
    rma20_low = ta.rma(low, 20)
    Flower = ta.crossover(rsi9, 30) and ema20_high < rma20_low
    Flower

// Function to get last Flower time and price in higher time frame
flower_info() =>
    Flower = flower_condition_tf()
    lastTime = ta.valuewhen(Flower, time, 0)
    lastPrice = ta.valuewhen(Flower, close, 0)
    [lastTime, lastPrice]

// Function to compute 'Fire' condition
fire_condition_tf() =>
    rsi9 = ta.rsi(close, 9)
    Fire = ta.crossover(rsi9, 90)
    Fire

// Function to get last Fire time and price in higher time frame
fire_info() =>
    Fire = fire_condition_tf()
    lastTime = ta.valuewhen(Fire, time, 0)
    lastPrice = ta.valuewhen(Fire, close, 0)
    [lastTime, lastPrice]

// Function to format the timestamp
formatTime(ts, isIntraday) =>
    yr = year(ts)
    mnth = month(ts)
    day = dayofmonth(ts)
    if isIntraday
        hr = hour(ts)
        min = minute(ts)
        str.format("{0}-{1}-{2} {3}:{4}", str.tostring(day, '00'), str.tostring(mnth, '00'), str.tostring(yr), str.tostring(hr, '00'), str.tostring(min, '00'))
    else
        str.format("{0}-{1}-{2}", str.tostring(day, '00'), str.tostring(mnth, '00'), str.tostring(yr))

// Create table
var table myTable = table.new(position.top_right, 7, 5, bgcolor=color.white, frame_color=color.black, frame_width=1)

// Add table headers
if barstate.isfirst
    table.cell(myTable, 0, 0, "Time Frame", text_color=color.black, bgcolor=color.gray)
    table.cell(myTable, 1, 0, "Flower Event", text_color=color.black, bgcolor=color.gray)
    table.cell(myTable, 2, 0, "Flower Date/Time", text_color=color.black, bgcolor=color.gray)
    table.cell(myTable, 3, 0, "Flower LTP", text_color=color.black, bgcolor=color.gray)
    table.cell(myTable, 4, 0, "Fire Event", text_color=color.black, bgcolor=color.gray)
    table.cell(myTable, 5, 0, "Fire Date/Time", text_color=color.black, bgcolor=color.gray)
    table.cell(myTable, 6, 0, "Fire LTP", text_color=color.black, bgcolor=color.gray)

// Function to process each time frame
process_time_frame(tf, tf_label, row) =>
    // Flower info
    [lastFlowerTime, lastFlowerPrice] = request.security(syminfo.tickerid, tf, flower_info(), lookahead=barmerge.lookahead_off)
    // Fire info
    [lastFireTime, lastFirePrice] = request.security(syminfo.tickerid, tf, fire_info(), lookahead=barmerge.lookahead_off)
    
    if barstate.islast
        table.cell(myTable, 0, row, tf_label, text_color=color.black)
        
        // Flower data
        if not na(lastFlowerTime)
            table.cell(myTable, 1, row, "🌸", text_color=color.black)
            table.cell(myTable, 2, row, formatTime(lastFlowerTime, tf == '60'), text_color=color.black)
            table.cell(myTable, 3, row, str.format("{0,number,#.00}", lastFlowerPrice), text_color=color.black)
        else
            table.cell(myTable, 1, row, "No Data", text_color=color.black)
            table.cell(myTable, 2, row, "N/A", text_color=color.black)
            table.cell(myTable, 3, row, "N/A", text_color=color.black)
        
        // Fire data
        if not na(lastFireTime)
            table.cell(myTable, 4, row, "🔥", text_color=color.black)
            table.cell(myTable, 5, row, formatTime(lastFireTime, tf == '60'), text_color=color.black)
            table.cell(myTable, 6, row, str.format("{0,number,#.00}", lastFirePrice), text_color=color.black)
        else
            table.cell(myTable, 4, row, "No Data", text_color=color.black)
            table.cell(myTable, 5, row, "N/A", text_color=color.black)
            table.cell(myTable, 6, row, "N/A", text_color=color.black)

// Process each time frame
process_time_frame('60', "1H", 1)
process_time_frame('D', "1D", 2)
process_time_frame('W', "1W", 3)
process_time_frame('M', "1M", 4)

// Plot 'Flower' symbols on the current chart's time frame
rsi9 = ta.rsi(close, 9)
ema20_high = ta.ema(high, 20)
rma20_low = ta.rma(low, 20)
Flower = ta.crossover(rsi9, 30) and ema20_high < rma20_low
plotshape(Flower, location=location.belowbar, color=color.yellow, style=shape.labelup, text="🌸", title="Flower")

// Plot 'Fire' symbols on the current chart's time frame
Fire = ta.crossover(rsi9, 90)
plotshape(Fire, location=location.abovebar, color=color.red, style=shape.labeldown, text="🔥", title="Fire")"

is code me table me jo data h wo kese static h jb bhi apan time frame change kr rahe h chart ka.