Bollinger Band and Moving Average v0.1 by JustUncleL

Jul 27, 2016

Static chart image
Signals
Channels
Moving Averages
Repainting Functionality

The Bollinger Band and Moving Average v0.1 indicator identifies high-probability mean-reversion trade setups by combining Bollinger Band breakouts with long-term trend filtering through Exponential Moving Averages (EMA).

Usage

The Usage section describes how the script can be used to identify potential market reversals. The strategy is primarily designed for intraday timeframes, such as the 5-minute chart, and focuses on two specific phases: the breakout and the retracement.

  • Breakout Identification: The script monitors for a "Mother Candle" that closes outside the Bollinger Bands. When this happens against the prevailing trend (as determined by the EMAs), a purple diamond appears above or below the bar, signaling a potential trade setup is approaching.
  • Trend Filtering: Trades are only considered if the breakout occurs in the opposite direction of the primary market trend. For a "PUT" signal, the market must be in a downtrend (Fast EMA < Slow EMA). For a "CALL" signal, the market must be in an uptrend (Fast EMA > Slow EMA).
  • Trade Execution: A trade signal (highlighted by a green "CALL" or red "PUT" triangle) is generated when a "Child Candle" forms. This candle must close in the opposite direction of the breakout candle. If the "Use Candle Size Filter" is enabled, the Child Candle must also be larger than the original breakout candle.
  • Timing: Once the Child Candle closes and the triangle appears, a trade can be initiated. For binary options or short-term scalping, the script suggests an expiry or hold time of 15 to 45 minutes depending on market volatility.

Details

The script utilizes a specific hierarchy of conditions to minimize false signals:

  1. Bollinger Basis: Standard Bollinger Bands are calculated using a Simple Moving Average (SMA) of 20 periods with a 2.0 standard deviation multiplier.
  2. Market Direction: Direction is determined by the relationship between a 180-period EMA (Fast) and a 365-period EMA (Slow). Additionally, the script checks if the Fast EMA is rising or falling over a user-defined number of candles to ensure momentum is consistent.
  3. Child Candle Logic: If the first candle after a breakout does not meet the size or direction requirements, the script checks the second candle. If neither of the two subsequent candles meets the criteria, the setup is invalidated.

This logic ensures that trades are only taken when there is evidence of strong price rejection and a return to the established trend. This script includes references to calculations by JayRogers.

Settings

Bollinger Settings

  • Bollinger Length: Sets the lookback period for the Bollinger Band SMA basis (default is 20).
  • Bollinger Multiplier: Sets the number of standard deviations for the upper and lower bands (default is 2).

Filter Settings

  • Use Candle size Filter: When enabled, the signal candle must be larger than the breakout candle to confirm strength.
  • Slow Moving Average Length: Sets the period for the long-term trend filter (default is 365).
  • Fast Moving Average Length: Sets the period for the short-term trend filter (default is 180).
  • Candles to test Market Direction: Determines how many bars the script looks back to confirm if the Fast EMA is rising or falling.

FAQ

How do I interpret the purple diamonds?
The purple diamonds are pre-warning alerts. They indicate that a candle has broken the Bollinger Band while the trend filter is active, suggesting a reversal signal may form on the next one or two candles.

Why are there no signals on my chart?
Because this indicator requires a strict confluence of Bollinger Band breakouts, specific EMA trend alignments, and candle size requirements, it generates fewer but higher-quality signals. Ensure your chart has enough historical data for the 365 EMA to calculate.

How can I access Bollinger Band and Moving Average v0.1?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

Free access on the following platforms
tradingviewSymbolTradingView
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

ninjatraderNinjaTrader
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

metatrader4MetaTrader 4/5
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

thinkorswimThinkorswim
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

Trading & investing are risky and many will lose money in connection with trading and investing activities. All content on this site is not intended to, and should not be, construed as financial advice. Decisions to buy, sell, hold or trade in securities, commodities and other investments involve risk and are best made based on the advice of qualified financial professionals. Past performance does not guarantee future results.

Hypothetical or Simulated performance results have certain limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, including, but not limited to, lack of liquidity. Simulated trading programs in general are designed with the benefit of hindsight, and are based on historical information. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.

Testimonials appearing on this website may not be representative of other clients or customers and is not a guarantee of future performance or success.

As a provider of technical analysis tools and strategies, we do not have access to the personal trading accounts or brokerage statements of our customers. As a result, we have no reason to believe our customers perform better or worse than traders as a whole based on any content, tool, or platform feature we provide.

Charts used on this site are by TradingView in which the majority of our technical indicators are built on. TradingView® is a registered trademark of TradingView, Inc. www.TradingView.com TradingView® has no affiliation with the owner, developer, or provider of the Services described herein.

Market data is provided by CBOE, CME Group, BarChart, Massive, CoinAPI. Select U.S. equities data is provided through Massive. CBOE BZX real-time U.S. equities data is licensed from CBOE and provided through BarChart. Real-time futures data is licensed from CME Group and provided through BarChart. Select cryptocurrency data, including major coins, is provided through CoinAPI. All data is provided “as is” and should be verified independently for trading purposes.

This does not represent our full Disclaimer. Please read our full disclaimer.

© 2026 LuxAlgo Global, LLC.