Indicator · Pine Script v4 · Own pane

QS Vix

by nvFede· code credited to QuantStreet

A Pine v4 indicator in a separate pane that builds a volatility gauge from the S&P 500 index.

View on GitHub

GitHub stars1on the repository
Pine versionv4older, still runs
Lines of code42
Settings2inputs
LicenceNone statedfile: MPL-2.0
Last update3 years ago19 Mar 2023

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

42 lines of Pine Script v4 from TradingView_old/2022/VIX-QS.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

VIX-QS.pine
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © QuantStreet

//@version=4
study("QS Vix", shorttitle="QSVIX")

bull_color = #058ac5
indecision_color = #dde4c5
bear_color = #ff583e

vix_high = security("SPX", timeframe.period, high)
vix_low = security("SPX", timeframe.period, low)
vix_close = security("SPX", timeframe.period, close)

val = input(20)

h = input(high)



short_vix = (highest(vix_high, val) - vix_low) / highest(vix_high, val) * 100

long_vix = (highest(vix_high, val * 10) - vix_low) / highest(vix_high, val * 10) * 100




//plot(short_vix, color=color.red)

tVIX = linreg(long_vix + short_vix, 5, 0) - 11

tvix_color = tVIX > 0 ?bear_color : bull_color

plot(-tVIX, style=plot.style_histogram, color=tvix_color)

vixMA = ema(-tVIX, 20)

//plot(vixMA, color=color.white)
plot(vixMA > 0 ? vixMA *  1.1 : na, color=color.white)
plot(vixMA < 0 ? vixMA *  0.9 : na, color=color.white)

hline(0)

Overview

QS Vix measures the distance of the current low from the highest high over a short window and a window ten times longer, as percentages, adds them and smooths the sum with a linear regression, then offsets it. Inputs set the window length and high source. It requests data from another symbol and needs it available.

Details

Published by

nvFede on GitHub

Code credit

QuantStreet, as written in the script's header

Type

Indicator, Pine Script v4

Draws

Separate pane below the 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.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
valint20val
hsourcehighh
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

This indicator calculates the distribution of close-to-close percentage changes using rate of change on closing prices. It bins percentage changes into intervals of 0.25 percent increments from negative to positive values and plots a normalized cumulative hist

Indicator v4 Volatility & bands
Updated 11 days ago · GPL-3.0 GitHub repository of Close-to-Close % Change Distribution

This indicator plots a Supertrend-based trend-following setup in a separate pane and skips conditions it treats as a sideways market. A volatility range is built from an ATR value, with RMA, SMA, EMA, or WMA smoothing, or from a fixed point distance. Optional

Indicator v5 TrendVolatility & bands
Updated 1 year ago · MPL-2.0 GitHub repository of Trend Following Setup - Sideways Market Skipper
330 stars

This indicator plots candle range and open-to-close movement as percentages in a separate pane. Range is the high-low difference divided by the low, and change is the close-open difference divided by the open. Both series draw as columns. Teal columns show ran

Indicator v5 Volatility & bands
Updated 2 months ago · None stated GitHub repository of Percent & Volatility [Alorse]

Mojito v3 Strategy

by namuan
318 stars

The Mojito v3 Strategy indicator evaluates volatility term structure by calculating the ratio between front-month and second-month VIX futures contracts. It smooths this ratio using a configurable median filter and compares the result against user-defined uppe

Indicator v5 Volatility & bands
Updated 2 months ago · MIT GitHub repository of Mojito v3 Strategy

Function - Logistic Equation

by ricardosantos79
261 stars

Calculates dynamic modeling values by applying a mathematical logistic differential equation to price change over a specified lookback length. It measures price momentum relative to the recent high-low price range. The script plots positive and negative logist

Indicator v5 Oscillators & momentumVolatility & bands
Updated 4 years ago · None stated GitHub repository of Function - Logistic Equation
228 stars

This indicator detects a Bollinger Band squeeze when the bands sit inside Keltner Channels, marking low volatility. It plots red dots during a squeeze and green dots when the bands are outside, in a separate pane. An optional histogram shows momentum as the cl

Indicator v6 Volatility & bandsOscillators & momentum
Updated 3 months ago · None stated GitHub repository of Bollinger Band Squeeze Detector

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