ok1
ok1

Reputation: 1

seperate data from a single request.security

//@version=5
indicator("FREC", overlay=true)
my_table = table.new(position = position.bottom_center, columns = 5, rows = 5, bgcolor = color.white, frame_color = color.black, border_color = color.red, frame_width = 20, border_width = 20)
symbol_name = syminfo.ticker
last_1440m_price = request.security(symbol_name, "1440", close)
table.cell_set_text_color(my_table,0,0,text_color = color.black)
table.cell_set_text_color(my_table,1,0,text_color = color.black)
table.cell_set_text_color(my_table,2,0,text_color = color.black)
table.cell_set_text(my_table, 0, 0, str.tostring(last_1440m_price[0], "#.##") + "%")
table.cell_set_text(my_table, 1, 0, str.tostring(last_1440m_price[360], "#.##") + "%")
table.cell_set_text(my_table, 2, 0, str.tostring(last_1440m_price[720], "#.##") + "%")

I just want to have an access for last 1440 min data and then get the close values of first minute 360 minute and 720 minute of that interval but I need to do this with a single request.security. it is fine when I try use request.security three times but it does not work with a single request.security. the values that I get do not match with the values which has to be and yes my chart is also set for 1m timeframe while I am trying.

I am trying to get last 1440 minute data and then try to access close values of candle's which I want

Upvotes: 0

Views: 54

Answers (1)

Rakesh Poluri
Rakesh Poluri

Reputation: 357

I think you misunderstand what request.security() does. When calling '1440' as the timeframe, you're getting a single 1440-minute candle. You will not be able to access lower timeframe data in that candle.

If your results are fine with three request.security() calls, you must settle for that. There are no workarounds for this situation.

Upvotes: 0

Related Questions