attempt to display RSI values across timeframes

23 Views Asked by At

My main objective is to display RSI of day, week and month across TF. While it comes correctly sometimes but when I move from day to week to month, the RSI of day displays incorrectly.

part of code is given below: I can share entire code if required.

myPeriod = input.int(defval=13, title='Period')
src = input(close)
myRSI = ta.rsi(src, myPeriod)

rsi_day = request.security(syminfo.tickerid, "D", myRSI)
rsi_week = request.security(syminfo.tickerid, "W", myRSI)
rsi_mth = request.security(syminfo.tickerid, "M", myRSI)

if(timeframe.period == "D")
table.cell(trendtable, 2, 2, text = str.tostring(math.round(rsi_day,2)), bgcolor = color.black, text_color=color.red) 
table.cell(trendtable, 3, 2, text = str.tostring(math.round(wma_day,2)), bgcolor = color.black, text_color=color.blue)
table.cell(trendtable, 4, 2, text = str.tostring(math.round(ema_day,2)), bgcolor = color.black, text_color=color.green)
0

There are 0 best solutions below