info
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © aseem64

//@version=5
indicator("info", overlay=true)

symbol_position = input.string(title='Symbol Position', options=["top_center", "middle_right", "None"], defval="top_center")

rsi_vix_position = input.string(title='RSI VIX Position', options=["top_center", "middle_right", "bottom_right",  "None"], defval="bottom_right")


india_vix = request.security("NSE:INDIAVIX", "D", close, lookahead = barmerge.lookahead_on)
india_vix:=math.round(india_vix,1)

us_vix = request.security("CBOE:VIX", timeframe.period, close)
us_vix:=math.round(us_vix,1)


//symbol tables  
var table top_center = table.new(position.top_center , 2, 2,  border_width = 1)
var table middle_right  = table.new(position.middle_right , 2, 2,  border_width = 1)

//vix and rsi tables
var table bottom_right = table.new(position.bottom_right , 2, 2,  border_width = 1)

//display symbol and timeframe 
if symbol_position == 'top_center'
    table.cell(top_center, 0, 0, syminfo.ticker, text_color=color.red, text_size=size.auto)
    table.cell(top_center, 1, 0, timeframe.period, text_color=color.red, text_size=size.auto)

    table.cell(top_center, 0, 1, "ST 10,2", text_color=color.red, text_size=size.auto)

if symbol_position == 'middle_right'
    table.cell(middle_right, 0, 0, syminfo.ticker, text_color=color.red, text_size=size.auto)
    table.cell(middle_right, 1, 0, timeframe.period, text_color=color.red, text_size=size.auto)

    table.cell(middle_right, 0, 1, "ST 10,2", text_color=color.red, text_size=size.auto)

if symbol_position == 'None'
    table.cell(top_center, 0, 0, '1', text_color=color.red, text_size=size.auto)

//display rsi and indiavix
rsi=ta.rsi(close, 14)
rsi:=math.round(rsi,1)

if rsi_vix_position == 'bottom_right'
    //table.cell(bottom_right, 0, 0, "INDIAVIX", text_color=color.red, text_size=size.auto)
    table.cell(bottom_right, 1, 0, str.tostring(india_vix), text_color=color.red, text_size=size.auto)
    
    //table.cell(bottom_right, 0, 1, "RSI", text_color=color.red, text_size=size.auto)
    table.cell(bottom_right, 1, 1, str.tostring(rsi), text_color=color.red, text_size=size.auto)

