OPEN-SOURCE SCRIPT

Williams Vix Fix ultra complete indicator (Tartigradia)

Cập nhật
Williams VixFix is a realized volatility indicator developed by Larry Williams, and can help in finding market bottoms.
Indeed, as Williams describe in his paper, markets tend to find the lowest prices during times of highest volatility, which usually accompany times of highest fear. The VixFix is calculated as how much the current low price statistically deviates from the maximum within a given look-back period.

Although the VixFix originally only indicates market bottoms, its inverse may indicate market tops. As masa_crypto writes: "The inverse can be formulated by considering "how much the current high value statistically deviates from the minimum within a given look-back period." This transformation equates Vix_Fix_inverse. This indicator can be used for finding market tops, and therefore, is a good signal for a timing for taking a short position." However, in practice, the Inverse VixFix is much less reliable than the classical VixFix, but is nevertheless a good addition to get some additional context.

For more information on the Vix Fix, which is a strategy published under public domain:
* The VIX Fix, Larry Williams, Active Trader magazine, December 2007, web.archive.org/web/20210115154821/https://www.marketcalls.in/wp-content/uploads/2014/12/VIXFix.pdf
* Fixing the VIX: An Indicator to Beat Fear, Amber Hestla-Barnhart, Journal of Technical Analysis, March 13, 2015, ssrn.com/abstract=2577930
* Replicating the CBOE VIX using a synthetic volatility index trading algorithm, Dayne Cary and Gary van Vuuren, Cogent Economics & Finance, Volume 7, 2019, Issue 1, doi.org/10.1080/23322039.2019.1641063

Created By ChrisMoody on 12-26-2014...
CM_Williams_Vix_Fix  Finds Market Bottoms

V3 MAJOR Update on 1-05-2014
CM_Williams_Vix_Fix_V3_Ultimate_Filtered_Alerts


tista merged LazyBear's Black Dots filter in 2020:
CM_Williams_Vix_Fix_V3_Ultimate_Filtered_Alerts_With_Threshold


Extended by Tartigradia in 10-2022:
* Can select a symbol different from current to calculate vixfix, allows to select SP:SPX to mimic the original VIX index.
* Inverse VixFix (from masa_crypto
Williams_VIX_fix_inverse
and web.archive.org/web/20221015105629/https://www.prorealcode.com/topic/the-ultimate-historical-and-implied-volatility-rank-and-percentile-indicator/page/2/)
* VixFix OHLC Bars plot
* Price / VixFix Candles plot (Pro Tip: draw trend lines to find good entry/exit points)
* Add ADX filtering, Minimaxis signals, Minimaxis filtering (from samgozman tradingview.com/script/9zutsrOa-vix-fix-double-pleasure/)
* Convert to pinescript v5
* Allow timeframe selection (MTF)
* Skip off days (more accurate reproduction of original VIX)
* Reorganized, cleaned up code, commented out parts, commented out or removed unused code (eg, some of the KC calculations)
* Changed default Bollinger Band settings to reduce false positives in crypto markets.

Set Index symbol to SPX, and index_current = false, and timeframe Weekly, to reproduce the original VIX as close as possible by the VIXFIX (use the Add Symbol option, because you want to plot CBOE:VIX on the same timeframe as the current chart, which may include extended session / weekends). With the Weekly timeframe, off days / extended session days should not change much, but with lower timeframes this is important, because nights and weekends can change how the graph appears and seemingly make them different because of timing misalignment when in reality they are not when properly aligned.
Phát hành các Ghi chú
Add license
Phát hành các Ghi chú
Update:
* Add a visual scaling factor for Price Divided By VixFix candles plot. But this is a temporary quick fix, as it needs to be tweaked per symbol. Ideally, we want the scaling to be more adaptive, to fit the whole screen.
Phát hành các Ghi chú
Update:
* Add options to allow enabling or disabling logscale for the vixfix histograms, bar plots, and price divided by vixfix candles plot.
Phát hành các Ghi chú
Update:
* finally implemented the correct fix for the automatic scaling of price divided by vixfix candles plot, for both the logscale and linear scale.
Phát hành các Ghi chú
Update:
* Fix calculation with skip_off_days, it used to calculate one day too much, hence the differences in graphs.
* Fix OHLC VixFix bars plot now uses skip_off_days calculation if enabled.
Phát hành các Ghi chú
Refresh example chart picture
Phát hành các Ghi chú
Update:
* automatically hide the Zero Line if both vixfix and inverse vixfix histograms are hidden, so that candles plots are auto scaled.
Phát hành các Ghi chú
Update:
* Restore more common default values for the bollinger band to generate entry/exit signals. The defaults now produce more false positives but miss fewer opportunities.
Phát hành các Ghi chú
Update:
* Improve autoscaling of Inverse VixFix along with Classical VixFix, by scaling according to the 99th percentile, instead of the max. This improves the visibility of the Inverse VixFix a lot.
Phát hành các Ghi chú
Update:
* Fix logscale option creating negative values for the classical vixfix.
* Fix a typo for inverse vixfix calculation.
* Enable logscale option by default, to more easily visualize bars highlights.
* Change default lookback period and bollinger band filter settings after empirical tests.
* Add a separate lookback period for inverse vixfix (more accurate highlights).
* Better functions documentation.
Phát hành các Ghi chú
Update:
* Set default to daily timeframe, because results aren't accurate in any other timeframe (contrary to Stochastic VixFix which remains accurate in any timeframe).
Phát hành các Ghi chú
Update:
* Revert timeframe to Chart and remove inaccurate code comment (weekly timeframe works great too).
Phát hành các Ghi chú
Update:
* Add Stochastic VixFix (SVIX), both as a filter or an additional background highlight. It's an additional metric that does not use an average of past prices such as a bollinger band, so it allows for an unbiased view of overreactions. Enabling it as a filter allow to reduce the number of false positives, at the expense of missing some good opportunities. Enabling it as a background highlight display a lot of other entries that are not detected by the classical VixFix. It's possible to use the smoothed SVIX with standard moving average or zero-lag MA or EMA or other natively supported moving averages types in TradingView as a filter or background highlight instead of the raw SVIX to reduce false positives further, at the expense of lagging and fewer opportunities.
Phát hành các Ghi chú
Update:
* Added another scholar article that clarifies how this indicator works (especially why we use a Bollinger Band).

Updated description, for those interested in the theory (and you should! You need to understand how your indicators work!):

As Odink 2016 explains, the VixFix cannot signal bottoms on its own: it needs a point of comparison, since it is not an oscillator, values are unbounded. One strategy is to combine with another indicator that averages over the past, to compare current volatility with past, with the goal of detecting **emotional overreactions** as evidenced by extreme volatility compared to historical volatility. Two published examples are the Hestla, 2015 strategy which uses a 20-SMA, or Odink, 2016 MOPOI strategy, using the upper level of the 20-Bollinger Band, which is just the 20-SMA + standard deviation. Note that the MOPOI strategy is equivalent to ChrisMoody's indicator for TradingView published in 2014, both were likely published independently from one another.

Phát hành các Ghi chú
Update:
* Fix typo: syminfo.ticker -> syminfo.tickerid , before we fetched the chart's symbol but potentially from another data provider than current chart, now we will use the exact same data as the chart.
Phát hành các Ghi chú
Changelog:
  • Restructured code and comments to make more sense.
  • Fixed a few edge case bugs with alerts (if they did not work correctly before, you may want to try again now).
  • Added a new filter based on the CCI SuperBands by Ankit_1618:
    CCI Super Bands


Enjoy!
Phát hành các Ghi chú
Changelog:
  • Forgot to mention that SVIX background highlights were made more transparent in the last update. But went a bit overboard, they were too transparent. Adjusted transparency to a reasonable degree now (70%).
sentimentsentimentanalysisVIX CBOE Volatility IndexvixfixvolatileVolatilityvolatilityindexvolatilityoscillator

Mã nguồn mở

Theo tinh thần TradingView thực sự, tác giả của tập lệnh này đã xuất bản dưới dạng nguồn mở để các nhà giao dịch có thể hiểu và xác minh. Chúc mừng tác giả! Bạn có thể sử dụng miễn phí. Tuy nhiên, bạn cần sử dụng lại mã này theo Quy tắc nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?

Thông báo miễn trừ trách nhiệm