Indicator · Pine Script v6 · On the chart

TR IV Surface

by Enesp4rl4k

This TradingView indicator draws an IV surface snapshot table on the price chart for VIOP options.

View on GitHub

GitHub stars7on the repository
Pine versionv6current
Lines of code61
Settings0inputs
LicenceMIT
Last update7 days ago23 Oct 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

61 lines of Pine Script v6 from src/bist_trader_mcp/pine_recipes/tr_iv_surface.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

tr_iv_surface.pine
//@version=6
// =============================================================================
// TR IV Surface — VIOP option implied-vol surface snapshot table on chart.
// Shows the ATM term structure, 25-delta skew (front month), and the front /
// back vol slope. Static snapshot — refresh via the MCP to update.
//
// Placeholders filled by the MCP at generation time:
//   {{UNDERLYING}}           — VIOP underlying, e.g. "XU030"
//   {{SPOT}}                 — spot price at snapshot time
//   {{ATM_TERM_JSON}}        — JSON array of {expiry, dte, atm_iv_pct}
//   {{SKEW_25D_PUT_PCT}}     — 25-delta put IV %
//   {{SKEW_25D_CALL_PCT}}    — 25-delta call IV %
//   {{SKEW_VOL_PTS}}         — put_iv - call_iv (vol points)
//   {{TERM_SLOPE_VOL_PTS}}   — front ATM - back ATM (vol points)
//   {{AS_OF_DATE}}           — YYYY-MM-DD snapshot
// =============================================================================
indicator("TR IV Surface — {{UNDERLYING}} ({{AS_OF_DATE}})", overlay = true)

spotPx        = {{SPOT}}
put25Pct      = {{SKEW_25D_PUT_PCT}}
call25Pct     = {{SKEW_25D_CALL_PCT}}
skewVolPts    = {{SKEW_VOL_PTS}}
termSlopePts  = {{TERM_SLOPE_VOL_PTS}}

// --- ATM term structure rows ------------------------------------------------
var string[] expiries = array.new<string>(0)
var float[]  dtes     = array.new<float>(0)
var float[]  atmIvs   = array.new<float>(0)

if barstate.isfirst
    {{ATM_TERM_LOADER}}

// --- Snapshot table ---------------------------------------------------------
var table iv = table.new(position.top_right, 3, 12, frame_color = color.gray,
                          border_color = color.gray)

if barstate.islast
    table.cell(iv, 0, 0, "Expiry",  bgcolor = color.new(color.gray, 60),
               text_color = color.white)
    table.cell(iv, 1, 0, "DTE",     bgcolor = color.new(color.gray, 60),
               text_color = color.white)
    table.cell(iv, 2, 0, "ATM IV%", bgcolor = color.new(color.gray, 60),
               text_color = color.white)

    n = math.min(array.size(expiries), 10)
    for i = 0 to n - 1
        table.cell(iv, 0, i + 1, array.get(expiries, i))
        table.cell(iv, 1, i + 1, str.tostring(array.get(dtes, i), "#"))
        table.cell(iv, 2, i + 1, str.tostring(array.get(atmIvs, i), "#.##"))

    rowSkew = n + 1
    table.cell(iv, 0, rowSkew, "25Δ Skew", bgcolor = color.new(color.orange, 60),
               text_color = color.white)
    table.cell(iv, 1, rowSkew, str.tostring(skewVolPts, "+#.##;-#.##"))
    table.cell(iv, 2, rowSkew, "vol pts")

    rowTerm = rowSkew + 1
    table.cell(iv, 0, rowTerm, "Term Slope", bgcolor = color.new(color.orange, 60),
               text_color = color.white)
    table.cell(iv, 1, rowTerm, str.tostring(termSlopePts, "+#.##;-#.##"))
    table.cell(iv, 2, rowTerm, "front-back")

Overview

TR IV Surface displays the ATM term structure with expiry, DTE, and ATM IV percent rows, plus 25-delta skew and term slope in vol points. The table updates statically on the last bar using MCP-filled placeholders for spot price, skew, and term data. No entry or exit signals exist as it is not a strategy. It applies to BIST indices and VIOP contracts with no user settings. The snapshot refreshes via the MCP server only and draws solely in the top-right chart position.

Details

Published by

Enesp4rl4k on GitHub

Draws

On the price chart

Markets

Indices

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Topics

bistborsa-istanbulclaudeevdsfinancellmmcpmodel-context-protocolpine-scriptpython

Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

ICT Liquidity Void Fill

by ArunKBhaskar
575 stars

This overlay indicator marks ICT liquidity void fills on the price chart and can show long and short signals. It places a Fibonacci level inside a displacement candle, defaulting to the midpoint, and draws lines in a chosen style. Optional filters limit the fi

Indicator v6 SMC / ICT / price actionSupport & resistance
Updated 1 year ago · MPL-2.0 GitHub repository of ICT Liquidity Void Fill

[RS]Donchian Fans

by ricardosantos79
261 stars

This indicator plots Donchian Channel boundary lines along with dynamic fan projections directly on the price chart. It calculates the highest high, lowest low, and median price over a customizable lookback period. Whenever price establishes a new channel high

Indicator v4 Support & resistanceTrend
Updated 4 years ago · None stated GitHub repository of [RS]Donchian Fans

Lux Trailing

by dearvn
257 stars

Plots kernel-smoothed price zones on the price chart using a Rational Quadratic kernel from an imported library. It builds an inner and an outer high-low zone from 15-minute highs and lows, plus a smoothed close and a midline, and marks bullish or bearish bars

Indicator v5 Support & resistanceVolatility & bands Repaints
Updated 7 weeks ago · None stated GitHub repository of Lux Trailing

Dynamic Linear Regression

by TradersPost
228 stars

Dynamic Linear Regression calculates and plots linear regression trendlines and standard deviation channels directly on the price chart over a user-selected time period. Traders can configure static channels locked at the end time, dynamic channels that contin

Indicator v6 TrendSupport & resistance
Updated 3 months ago · None stated GitHub repository of Dynamic Linear Regression

Candlestick Patterns

by harryguiacorn
220 stars

This indicator plots optional candlestick pattern signals on the price chart. It detects engulfing bars, inside bars, HOLP and LOHP, kicker patterns, body-mass extremes, higher highs and lower lows, ATR warnings, and four-bar fractals. Optional pivot marks use

Indicator v5 Candlestick patternsVolatility & bands
Updated 1 year ago · None stated GitHub repository of Candlestick Patterns

More Volatility & bands scripts

Related on ForexR

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers