Loading Data ...
This demo uses the PineTS library to load the market data and calculate the Williams VIX Fix indicator, and QFChart library for visualizing the results.
Loading Data ...
The Williams VIX Fix (WVF) is a volatility indicator created by renowned trader Larry Williams to replicate the behavior of the CBOE VIX (Volatility Index) for any market or asset. While the VIX measures implied volatility of S&P 500 options, the Williams VIX Fix uses price action alone to identify fear and panic selling, making it applicable to stocks, forex, cryptocurrencies, and commodities. High WVF values indicate extreme selling pressure and potential market bottoms, while low values suggest complacency and stability.
The indicator measures the distance between the current low and the highest close over a lookback period:
WVF = ((Highest Close over Period - Current Low) / Highest Close) × 100
The calculation captures the key insight: when prices fall sharply from recent highs, fear increases. The indicator includes several components:
The Williams VIX Fix generates signals when extreme fear presents buying opportunities:
This implementation includes adjustable parameters for different trading styles:
The indicator capitalizes on market psychology:
This demo showcases the full calculation and visualization of the Williams VIX Fix using PineTS and QFChart. PineTS computes the indicator across 500 daily BTC/USDT candles from Binance, calculating highest closes, standard deviations, percentiles, and dynamic thresholds. QFChart renders the histogram with color-coded bars and threshold lines in a separate pane below the price chart.
The indicator demonstrates several advanced features:
input.int(), input.float(), and
input.bool() for customization
Here's the core calculation logic:
const WillVixFix = (context) => {
const pd = input.int(22, 'LookBack Period Standard Deviation High');
const bbl = input.int(20, 'Bolinger Band Length');
const mult = input.float(2.0, 'Bollinger Band Standard Devaition Up');
const lb = input.int(50, 'Look Back Period Percentile High');
const ph = input.float(0.85, 'Highest Percentile - 0.85=85%');
// Main WVF calculation
const wvf = ((ta.highest(close, pd) - low) / ta.highest(close, pd)) * 100;
// Bollinger Bands
const sDev = mult * ta.stdev(wvf, bbl);
const midLine = ta.sma(wvf, bbl);
const upperBand = midLine + sDev;
// Percentile thresholds
const rangeHigh = ta.highest(wvf, lb) * ph;
// Color logic: lime if extreme fear, gray otherwise
const col = wvf >= upperBand || wvf >= rangeHigh ? color.lime : color.gray;
plot(rangeHigh, 'RangeHigh', { color: 'lime' });
plot(upperBand, 'UpperBand', { color: 'aqua' });
plot(wvf, 'WilliamsVixFix', { style: 'histogram', color: col });
};
| Feature | CBOE VIX | Williams VIX Fix |
|---|---|---|
| Data Source | S&P 500 options implied volatility | Price action (high/low/close) |
| Assets | S&P 500 only | Any asset (stocks, crypto, forex, commodities) |
| Availability | Real-time data requires subscription | Calculated from free price data |
| Interpretation | High VIX = fear, Low VIX = complacency | Lime = fear, Gray = normal |
| Calculation | Complex options pricing model | Simple highest/lowest formula |
To use the Williams VIX Fix in your own application:
// Load market data and calculate indicator
const pineTS = new PineTS(PineTS.Provider.Binance, 'BTCUSDT', 'D', 500);
const { plots, marketData } = await pineTS.run(WillVixFix);
// Initialize chart
const chart = new QFChart.QFChart(container, {
title: 'BTC/USDT - Daily',
height: '800px',
layout: { mainPaneHeight: '60%', gap: 5 }
});
// Set data and add indicator
chart.setMarketData(marketData);
chart.addIndicator('Williams VIX Fix', plots, {
isOverlay: false,
height: 25
});