OPEN-SOURCE SCRIPT

vix

//version=5
indicator("Mikfiton Vix", overlay=false)

// India VIX input using the chart's timeframe
vixSource = request.security("NSE:INDIAVIX", timeframe.period, close)

// Determine the color of the VIX line based on the trend
vixColor = vixSource > vixSource[1] ? color.red : color.green

// Plot India VIX with dynamic color based on trend
plot(vixSource, title="India VIX", color=vixColor, linewidth=2)

// Define volatility ranges
stableRange = vixSource >= 9 and vixSource < 12
volatileRange = vixSource >= 12 and vixSource < 14
highlyVolatileRange = vixSource >= 14 and vixSource <= 20

// Fill area based on volatility ranges
bgcolor(stableRange ? color.new(color.green, 90) : na, title="Stable Zone")
bgcolor(volatileRange ? color.new(color.yellow, 90) : na, title="Volatile Zone")
bgcolor(highlyVolatileRange ? color.new(color.red, 90) : na, title="Highly Volatile Zone")
Volatility

开源脚本

本着真正的TradingView精神,此脚本的作者已将其开源,以便交易者可以理解和验证它。向作者致敬!您可以免费使用它,但在出版物中重复使用此代码受网站规则约束。 您可以收藏它以在图表上使用。

想在图表上使用此脚本?

免责声明