Fancy Bollinger Bands Strategy
Jan 21, 2021

The Fancy Bollinger Bands Strategy indicator is a comprehensive volatility-based tool that integrates highly customizable Bollinger Bands with a robust backtesting strategy engine. It allows users to define unique entry and exit conditions based on price action relative to the bands, bandwidth metrics, and Percent B values.
Usage
The Usage section focuses on the dual nature of this script: visual analysis and automated strategy testing. Users can employ the indicator to identify overextended price levels or trend shifts using the "Fancy" MA features.
Example usage scenarios:
- Trend Following: Set the strategy to open long positions when price crosses above the middle band and close when it crosses below the upper band.
- Volatility Breakouts: Utilize the Band Width conditions to trigger trades only when the market enters a high-volatility state (expansion).
- Mean Reversion: Configure entries when Percent B crosses below a specific threshold (e.g., 0.05) and exits upon reaching the middle band.
Details
This script enhances the traditional Bollinger Band concept by offering multiple calculation methods for both the basis (middle band) and the deviations.
- Middle Band Flexibility: Unlike standard Bollinger Bands which use an SMA, this version supports 8 different MA types, including HMA and TEMA, and allows for multi-timeframe (MTF) resolution and alternative candle types (Heikin Ashi, Renko, etc.).
- Deviation Methods: Users can toggle between standard deviation and ATR-based deviations to better suit different market environments.
- Forecasting: The tool includes a forecasting mechanism that projects the MA based on user-defined bias (Bullish, Bearish, or Neutral), helping traders anticipate potential future band levels.
Settings
Middle Band Settings
- Middle Band Period: The lookback length for the central moving average.
- Middle Band Type: Selection of MA algorithm (SMA, EMA, WMA, RMA, HMA, DEMA, TEMA, VWMA).
- Middle Band Resolution: Allows the calculation of the bands based on a different timeframe than the chart.
- Middle Band Candle Type: Selects the price data source type (e.g., Heikin Ashi).
Band Calculation & Visuals
- Upper/Lower Band Multiplier: Adjusts the width of the bands relative to the volatility measure.
- Use ATR Deviation Instead of Standard Deviation?: Toggles the volatility calculation method.
- Highlight Inclusions / Ghost Trail: Visual toggles to show specific calculation periods and historical "ghost" data.
- Show Forecasts: Displays projected levels for the middle band.
Strategy Settings
- Backtest Range: Defines the start and end dates for the strategy execution.
- Take Profit / Stop Loss %: Sets percentage-based exit targets.
- Open/Close Condition Requirements: Determines if "Any," "All," or a "Minimum count" of selected conditions must be met to trigger a trade.
- Condition Selectors: A series of dropdowns to assign specific price, bandwidth, or Percent B events to "Long Open," "Long Close," or both.
FAQ
How do I use the Forecast Bias setting? The Forecast Bias allows you to simulate how the bands might react if the price trends in a specific direction over the forecast period. "Neutral" assumes the price stays the same, while "Bullish" or "Bearish" applies a directional magnitude to the projection.
What is the benefit of using ATR Deviation? ATR (Average True Range) deviation can be more reactive to recent price gaps and volatility spikes compared to standard deviation, which may provide more consistent band wrapping in certain trending markets.
How do I access Fancy Bollinger Bands Strategy? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Free indicator
Get free access to this indicator on the platforms below.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.