IDEAL BB with MA (With Alerts)
Nov 16, 2021

The IDEAL BB with MA (With Alerts) tool integrates multi-layered trend analysis by combining Bollinger Bands, specialized Moving Averages, and signal-optimized smoothing techniques to identify potential market reversals and trend continuations.
Usage
The Usage section describes how the script can be used to identify trend direction and volatility-based entry points. Traders can utilize the visual overlaps to confirm market momentum.
- Trend Identification: The script uses a combination of a nested moving average (NMA) and a Hull Moving Average (HMA) system. When the fast HMA component crosses above the slow component, a "Buy" label appears; conversely, a "Sell" label appears when the fast component crosses below the slow component.
- Volatility Monitoring: The integrated Bollinger Bands provide dynamic support and resistance levels. A crossover of the upper or lower bands can signal overextended market conditions or the start of a new volatility expansion.
- Momentum Confirmation: The NMA (plotted as a step line) and the VWAP Middle line serve as baseline filters. Price action relative to these lines helps determine if the current trend is maintaining its strength.
Details
The script incorporates several advanced mathematical concepts to reduce lag while maintaining smoothness in its outputs:
- Nested Moving Average (NMA): This calculation applies a primary MA and then a secondary MA of that result, using a scaling factor (alpha) to compensate for the inherent lag of traditional moving averages.
- Kahlman Filter Integration: Users can toggle a Kahlman filter on the Hull Moving Average components. This filter uses a gain setting to dynamically adjust the smoothing based on price velocity, aiming to minimize "noise" in volatile markets.
- Triple Hull Moving Average (HMA3): This variation of the HMA uses three different weighted moving average lengths to create a more responsive signal line compared to a standard HMA.
Settings
Main Inputs
- 1st Length: Sets the primary lookback period for the Nested Moving Average (NMA).
- 2nd Length: Sets the secondary lookback period for the NMA calculation.
- MA Type: Selects the smoothing method for the NMA (EMA, SMA, VWMA, or WMA).
- Source: Determines the price data used for the NMA (e.g., HL2, Close).
VWAP & Hull Settings
- VWAP Length/Source/Offset: Controls the parameters for the Volume Weighted Average Price middle line.
- Price Data (Hull): The source input for the Hull Moving Average crossover logic.
- Lookback (Hull): The period used to calculate the HMA signal lines.
- Show cross over/under: Toggles the visibility of the "Buy" and "Sell" labels on the chart.
- Gain: Adjusts the sensitivity of the Kahlman filter.
- Use Kahlman: A checkbox to enable or disable Kahlman smoothing on the signal lines.
FAQ
How do I interpret the colored background fill between the HMA lines? The fill changes color based on the relationship between the two Hull Moving Average components. A green fill indicates bullish momentum (fast line above slow), while a red fill indicates bearish momentum (fast line below slow).
What do the "Buy" and "Sell" labels signify? These labels represent a crossover event between the two internal HMA signal lines, suggesting a potential shift in short-term trend direction.
How can I access the IDEAL BB with MA (With Alerts)? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
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.

