PROTECTED SOURCE SCRIPT
India VIX Range Lines + Accurate Table

//version=5
indicator("India VIX Range Lines + Accurate Table", overlay=true, max_lines_count=500)
// === STYLE INPUTS ===
lineWidth = input.int(2, "Line Width", minval=1)
upperColor = input.color(color.green, "Upper Line Color")
lowerColor = input.color(color.red, "Lower Line Color")
midColor = input.color(color.yellow, "Today Open Line Color")
// === TABLE THEME INPUTS ===
tableBgColor = input.color(color.new(color.black, 80), "Table Background Color")
tableBorder = input.color(color.white, "Table Border Color")
headerBgColor = input.color(color.new(color.blue, 60), "Header Background Color")
headerTextColor = input.color(color.white, "Header Text Color")
cellBgColor = input.color(color.new(color.gray, 60), "Cell Background Color")
cellTextColor = input.color(color.white, "Cell Text Color")
// === PARAMETERS ===
vixDivisor = 19.1 // fixed divisor
// === DATA FETCH ===
// India VIX daily open
indiaVixOpen = request.security("INDIAVIX", "D", open)
// Today's index first bar open (intraday-friendly)
var float todayOpen = na
if ta.change(time("D"))
todayOpen := open
// === CALCULATIONS ===
var float x = na
var float y = na
var float upperLine = na
var float lowerLine = na
if not na(todayOpen)
x := indiaVixOpen / vixDivisor // exact x = IndiaVIX Open / 19.1
y := todayOpen * x / 100 // range offset
upperLine := todayOpen + y
lowerLine := todayOpen - y
// === PLOT LINES (Fixed for the Day) ===
plot(upperLine, color=upperColor, style=plot.style_line, linewidth=lineWidth, title="Upper Line")
plot(lowerLine, color=lowerColor, style=plot.style_line, linewidth=lineWidth, title="Lower Line")
plot(todayOpen, color=midColor, style=plot.style_line, linewidth=lineWidth, title="Today Open Line")
// === TABLE DISPLAY ===
var table infoTable = table.new(position=position.top_right, columns=2, rows=7, border_width=1, frame_color=tableBorder, frame_width=1, bgcolor=tableBgColor)
if barstate.islast
table.cell(infoTable, 0, 0, "India VIX Open", text_color=headerTextColor, bgcolor=headerBgColor)
table.cell(infoTable, 1, 0, str.tostring(indiaVixOpen, "#.##"), text_color=cellTextColor, bgcolor=cellBgColor)
table.cell(infoTable, 0, 1, "VIX Divisor", text_color=headerTextColor, bgcolor=headerBgColor)
table.cell(infoTable, 1, 1, str.tostring(vixDivisor, "#.##"), text_color=cellTextColor, bgcolor=cellBgColor)
table.cell(infoTable, 0, 2, "X Value (VIX / 19.1)", text_color=headerTextColor, bgcolor=headerBgColor)
table.cell(infoTable, 1, 2, str.tostring(x, "#.#####"), text_color=cellTextColor, bgcolor=cellBgColor)
table.cell(infoTable, 0, 3, "Today Open", text_color=headerTextColor, bgcolor=headerBgColor)
table.cell(infoTable, 1, 3, str.tostring(todayOpen, "#.##"), text_color=cellTextColor, bgcolor=cellBgColor)
table.cell(infoTable, 0, 4, "Y Value (Range Offset)", text_color=headerTextColor, bgcolor=headerBgColor)
table.cell(infoTable, 1, 4, str.tostring(y, "#.#####"), text_color=cellTextColor, bgcolor=cellBgColor)
table.cell(infoTable, 0, 5, "Upper Line", text_color=headerTextColor, bgcolor=headerBgColor)
table.cell(infoTable, 1, 5, str.tostring(upperLine, "#.##"), text_color=cellTextColor, bgcolor=cellBgColor)
table.cell(infoTable, 0, 6, "Lower Line", text_color=headerTextColor, bgcolor=headerBgColor)
table.cell(infoTable, 1, 6, str.tostring(lowerLine, "#.##"), text_color=cellTextColor, bgcolor=cellBgColor)
indicator("India VIX Range Lines + Accurate Table", overlay=true, max_lines_count=500)
// === STYLE INPUTS ===
lineWidth = input.int(2, "Line Width", minval=1)
upperColor = input.color(color.green, "Upper Line Color")
lowerColor = input.color(color.red, "Lower Line Color")
midColor = input.color(color.yellow, "Today Open Line Color")
// === TABLE THEME INPUTS ===
tableBgColor = input.color(color.new(color.black, 80), "Table Background Color")
tableBorder = input.color(color.white, "Table Border Color")
headerBgColor = input.color(color.new(color.blue, 60), "Header Background Color")
headerTextColor = input.color(color.white, "Header Text Color")
cellBgColor = input.color(color.new(color.gray, 60), "Cell Background Color")
cellTextColor = input.color(color.white, "Cell Text Color")
// === PARAMETERS ===
vixDivisor = 19.1 // fixed divisor
// === DATA FETCH ===
// India VIX daily open
indiaVixOpen = request.security("INDIAVIX", "D", open)
// Today's index first bar open (intraday-friendly)
var float todayOpen = na
if ta.change(time("D"))
todayOpen := open
// === CALCULATIONS ===
var float x = na
var float y = na
var float upperLine = na
var float lowerLine = na
if not na(todayOpen)
x := indiaVixOpen / vixDivisor // exact x = IndiaVIX Open / 19.1
y := todayOpen * x / 100 // range offset
upperLine := todayOpen + y
lowerLine := todayOpen - y
// === PLOT LINES (Fixed for the Day) ===
plot(upperLine, color=upperColor, style=plot.style_line, linewidth=lineWidth, title="Upper Line")
plot(lowerLine, color=lowerColor, style=plot.style_line, linewidth=lineWidth, title="Lower Line")
plot(todayOpen, color=midColor, style=plot.style_line, linewidth=lineWidth, title="Today Open Line")
// === TABLE DISPLAY ===
var table infoTable = table.new(position=position.top_right, columns=2, rows=7, border_width=1, frame_color=tableBorder, frame_width=1, bgcolor=tableBgColor)
if barstate.islast
table.cell(infoTable, 0, 0, "India VIX Open", text_color=headerTextColor, bgcolor=headerBgColor)
table.cell(infoTable, 1, 0, str.tostring(indiaVixOpen, "#.##"), text_color=cellTextColor, bgcolor=cellBgColor)
table.cell(infoTable, 0, 1, "VIX Divisor", text_color=headerTextColor, bgcolor=headerBgColor)
table.cell(infoTable, 1, 1, str.tostring(vixDivisor, "#.##"), text_color=cellTextColor, bgcolor=cellBgColor)
table.cell(infoTable, 0, 2, "X Value (VIX / 19.1)", text_color=headerTextColor, bgcolor=headerBgColor)
table.cell(infoTable, 1, 2, str.tostring(x, "#.#####"), text_color=cellTextColor, bgcolor=cellBgColor)
table.cell(infoTable, 0, 3, "Today Open", text_color=headerTextColor, bgcolor=headerBgColor)
table.cell(infoTable, 1, 3, str.tostring(todayOpen, "#.##"), text_color=cellTextColor, bgcolor=cellBgColor)
table.cell(infoTable, 0, 4, "Y Value (Range Offset)", text_color=headerTextColor, bgcolor=headerBgColor)
table.cell(infoTable, 1, 4, str.tostring(y, "#.#####"), text_color=cellTextColor, bgcolor=cellBgColor)
table.cell(infoTable, 0, 5, "Upper Line", text_color=headerTextColor, bgcolor=headerBgColor)
table.cell(infoTable, 1, 5, str.tostring(upperLine, "#.##"), text_color=cellTextColor, bgcolor=cellBgColor)
table.cell(infoTable, 0, 6, "Lower Line", text_color=headerTextColor, bgcolor=headerBgColor)
table.cell(infoTable, 1, 6, str.tostring(lowerLine, "#.##"), text_color=cellTextColor, bgcolor=cellBgColor)
Geschütztes Skript
Dieses Script ist als Closed-Source veröffentlicht. Sie können es kostenlos und ohne Einschränkungen verwenden – erfahren Sie hier mehr.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Geschütztes Skript
Dieses Script ist als Closed-Source veröffentlicht. Sie können es kostenlos und ohne Einschränkungen verwenden – erfahren Sie hier mehr.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.