TradingView indicator guides

Fibonacci Bollinger Bands: VWMA, Ratios and Pine Script

Fibonacci Bollinger Bands in this example place twelve price bands around a volume-weighted moving average. Each distance is a selected ratio times a standard-deviation multiplier. The ratios divide the channel; they do not establish support, reversal odds or a guaranteed coverage percentage.

Inspect the Pine Script

Read the formula before interpreting the levels

The supplied indicator uses length 200, source hlc3 and multiplier 3 by default. Its basis is ta.vwma(source, length). Its deviation is multiplier × ta.stdev(source, length). Each upper or lower line is basis ± ratio × deviation, for ratios 0.236, 0.382, 0.5, 0.618, 0.764 and 1. The basis plus six pairs gives thirteen plots.

The standard deviation is the built-in unweighted price-series calculation, with its default biased estimate. It is not a volume-weighted deviation around the VWMA. The basis and dispersion therefore use different weighting. Do not substitute a weighted variance and assume you reproduced this script.

Rashad’s public TradingView FBB script documents this VWMA-centered variant. That publication is useful for identifying the variant; its description of three-standard-deviation coverage does not establish empirical coverage on a price feed. The exact source below is the implementation discussed here.

Worked levels: 0.618 is a fraction of the full offset

Suppose a hypothetical window produces basis 100 and standard deviation 2. At multiplier 3, deviation is 6. The resulting levels are:

RatioDistance from basisLowerUpper
0.2361.41698.584101.416
0.3822.29297.708102.292
0.5397103
0.6183.70896.292103.708
0.7644.58495.416104.584
1694106

The 0.618 line is 1.854 standard deviations from the basis when multiplier is 3, not 0.618 standard deviations. The outer width is 2 × multiplier × standard deviation. Holding everything else fixed, increasing the multiplier from 3 to 3.5 increases every offset by 16.67%; increasing it from 2 to 2.5 increases offsets by 25%. Neither change specifies a percentage change in touches or profitable trades.

Volume weighting survives a change to close

Changing source from hlc3 to close changes the price series, not the VWMA method. A valid window’s VWMA is sum(source × volume) / sum(volume). TradingView’s VWMA documentation distinguishes this volume weighting from an equally weighted average.

For a two-bar hypothetical source of 100 and 110 with volumes 1 and 9, the VWMA is 109; the SMA is 105. The default population standard deviation of those two prices is 5. With multiplier 3, the outer bands are 94 and 124, centered on 109. Changing only the second volume to 1 moves the basis to 105 but leaves that unweighted deviation at 5. This isolates the volume effect without a market-performance claim.

The snippet contains no explicit missing-volume check or fallback. Missing data, a zero total volume window or unsuitable volume semantics can make its basis unavailable or unsuitable for your purpose. Check the feed and available history first. Spot FX tick volume and exchange trade volume are different inputs. Choosing an SMA basis would remove volume weighting, but would create a different indicator.

Why three standard deviations are not a trading probability

The familiar normal-distribution probability concerns observations within three population standard deviations of that distribution’s mean. It is not a promise that a rolling price channel will contain a fixed percentage of future prices. This example also combines a VWMA center with an unweighted deviation, so the usual center-and-dispersion interpretation does not directly apply.

A wick touch, close beyond a band and subsequent move back inside are different observations. If investigating one, define the event precisely, use information available at the decision time and measure it on a specified symbol, feed, session and timeframe. Define entry, exit, costs and sizing before calling the result a strategy backtest. No win rate or reversal frequency is established by this page.

All calculations include the current chart bar and may update before it closes. The snippet has no confirmation gate, alerts, orders or RSI/ADX filters. Thirteen levels can create many possible rules and increase the opportunity to choose a favorable historical result after seeing the data. Test a preselected rule on separate data.

Compare constructions, not unsupported performance rankings

For a simpler standard-deviation channel, inspect Bollinger Bands and its selected basis and multiplier. For range-based offsets, inspect the actual Keltner Channel implementation. FBB’s extra levels do not establish lower lag, better entries or more reliable support.

The length counts chart observations. Two hundred four-hour bars correspond to 800 bar-hours; converting that to calendar days requires the instrument’s session schedule and available bars. A shorter length changes both the rolling basis and dispersion. It does not guarantee narrower bands or a particular responsiveness ratio. Compare values on the intended chart instead of treating a timeframe preset as proven.

Pine Script v6: implementation and limits

Paste the full source into Pine Editor and add it to a chart with usable volume history. Confirm the three inputs and inspect a known bar in the Data Window. Purple is the VWMA basis, red and green are the outer pair, and teal marks the ten intermediate lines.

Pine Script v6
//@version=6
indicator(title="Fibonacci Bollinger Bands", overlay=true, max_labels_count=500)

// Inputs
length = input.int(200, "Length", minval=1)
src = input.source(hlc3, "Source")
mult = input.float(3.0, "Multiplier", minval=0.5, step=0.1)

// FBB Calculation
basis = ta.vwma(src, length)
dev = mult * ta.stdev(src, length)

// Fibonacci Band Levels
upper_1   = basis + 1.0   * dev
upper_0764= basis + 0.764 * dev
upper_0618= basis + 0.618 * dev
upper_05  = basis + 0.5   * dev
upper_0382= basis + 0.382 * dev
upper_0236= basis + 0.236 * dev

lower_0236= basis - 0.236 * dev
lower_0382= basis - 0.382 * dev
lower_05  = basis - 0.5   * dev
lower_0618= basis - 0.618 * dev
lower_0764= basis - 0.764 * dev
lower_1   = basis - 1.0   * dev

// Plot
plot(basis, "Basis", color=color.new(#9C27B0, 0), linewidth=2)
plot(upper_1, "Upper (1)", color=color.new(#F23645, 0), linewidth=2)
plot(upper_0764, "Upper (0.764)", color=color.new(#00BCD4, 0), linewidth=1)
plot(upper_0618, "Upper (0.618)", color=color.new(#00BCD4, 0), linewidth=1)
plot(upper_05, "Upper (0.5)", color=color.new(#00BCD4, 0), linewidth=1)
plot(upper_0382, "Upper (0.382)", color=color.new(#00BCD4, 0), linewidth=1)
plot(upper_0236, "Upper (0.236)", color=color.new(#00BCD4, 0), linewidth=1)
plot(lower_0236, "Lower (0.236)", color=color.new(#00BCD4, 0), linewidth=1)
plot(lower_0382, "Lower (0.382)", color=color.new(#00BCD4, 0), linewidth=1)
plot(lower_05, "Lower (0.5)", color=color.new(#00BCD4, 0), linewidth=1)
plot(lower_0618, "Lower (0.618)", color=color.new(#00BCD4, 0), linewidth=1)
plot(lower_0764, "Lower (0.764)", color=color.new(#00BCD4, 0), linewidth=1)
plot(lower_1, "Lower (1)", color=color.new(#4CAF50, 0), linewidth=2)
Existing indicator chart preview
Existing visual preview. Verify exact values against the source; the image is not a performance result.

Specify a checkable adaptation in Pineify

Specify VWMA as the basis, an unweighted standard deviation, the six ratios and the multiplier independently. Request any missing-data handling and closed-bar alerts explicitly. Ask for a syntax check and compare calculated values with the reference; access and usage quotas depend on the current plan.

Open Pine Script AI Coding Agent

Educational indicator analysis. No measured trading performance is established here. Syntax validation does not prove formula equivalence, execution assumptions or profitability.

Implementation questions

Length starts at 200 and must be at least 1. Source starts at hlc3. Multiplier starts at 3, with a minimum of 0.5 and step of 0.1. These are defaults and input constraints, not optimized settings.

No. Here it is 61.8% of the current full standard-deviation offset from the VWMA. The code does not locate swing highs or lows, anchor a retracement grid or detect support.

With valid positive volume, the VWMA equals the current source and the population standard deviation is zero, so the bands collapse onto the basis. It is not a useful nonzero volatility channel in that case.

The thirteen plots have separate names and can be managed in TradingView’s Style settings. Hiding plots changes the display, not the formula or statistical validity of a trading rule.

No. ta.vwma still uses volume when its price source is close. Check the volume feed or explicitly choose a different basis method; do not silently replace missing volume with a fabricated value.

You can request a specific alert condition, including which ratio, whether a high/low touch or close crossing counts, and whether bar confirmation is required. Review the generated source and test the event in TradingView. The displayed indicator itself has no alerts.