Adjustable MA & Alternating Extremities
May 3, 2021

Returns a moving average with customizable lag and overshoot amplitude using a parametric kernel. The indicator highlights alternating extremities, suggesting where prices might reverse, and includes an option to display the moving average as candles instead of a solid line.
Enhance Your Trading Strategy with Customizable Moving Average
This unique Moving Average indicator is designed to enhance your trading strategy by allowing you to adjust the lag and overshoot amplitude through a parametric kernel, offering greater control and precision. This advanced feature helps traders in identifying potential price reversals by displaying alternating extremities. Furthermore, you can visualize the moving average not just as a line but as candles, providing a fresh perspective on price movements.
Settings
- Length: Defines the MA period, representing the number of recent data points utilized for calculation.
- Mult: A multiplicative factor applied to each extremity.
- As Smoothed Candles: Option to render the MA as a series of candles instead of a traditional line.
- Show Alternating Extremities: Controls the visibility of alternating extremities.
- Lag: Adjusts the MA's lag; higher values result in more lag.
- Overshoot: Modifies the overshoots' amplitude, with higher values enhancing overshoot amplitude.
How to Trade with the Customizable Moving Average?
By utilizing parametric kernels, traders gain enhanced control over the moving average's lag and smoothness. This is highly beneficial for analysts seeking precision. A moving average with minimized lag can serve as a leading indicator in a crossover system, while increased lag is advantageous for slow indicators in the same system. Adjusting 'Lag' enhances smoothness, whereas increasing 'Overshoot' reduces lag.
The indicator emphasizes alternating extremities: an upper extremity appears when the high price surpasses it, while the low extremity is highlighted when the low price falls below it. These extremities function similarly to those in band indicators.
Utilizing an MA with a length of 200 and a multiplicative factor of 1 allows traders to determine points where price might rebound in ranging markets. In trending markets, closing prices are generally above the upper extremity and below the lower extremity. Reducing lag offers a more precise estimate of the underlying trend, while the extremities provide potential reversal points even in prevalent trends.
The above chart illustrates how the price initially breaks the upper extremity, but eventually, the upper extremity aligns with the price and acts as a resistance level, signaling a potential reversal.
Plotting candles from the moving average is similar to heikin-ashi candles, differing in that CandleOpen(t) does not equal CandleClose(t-1). Each candle is calculated as follows:
- Open: Average of MA(t-1) and MA(t-2)
- High: MA from the high price
- Low: MA from the low price
- Close: MA from the closing price
Exploring the Technical Specifics
Lag is the time delay in moving averages responding to price changes, leading to potential false signals. More filtering within the moving average leads to greater lag. Conversely, overshooting happens when a non-lagging moving average overshoots a maximum or minimum threshold, known as undershooting if below.
MA and rolling max/min, both with a 50-bar length. Lag is the trade-off for smoothness, while overshooting balances reduced lag at times. Understanding the kernel design is crucial for reducing lag and increasing accuracy in moving averages. Generally, an MA is a weighted sum of past prices and kernel coefficients:
MA(t) = b(0)C(t) + b(1)C(t-1) + b(2)C(t-2) + ... + b(n-1)C(t-n-1)
By slightly "underweighting" past prices, the lag is non-optimally reduced. Our custom moving average utilizes a modified sinewave kernel, aiming to transform a weighted sum from a basic oscillator to a low lag moving average. The kernel equation used is:
sin(2πx^α)(1 - x^β)
Where 1>x>0; α controls lag, β manages overshoot amplitude. Various kernels are achievable through equation adjustments:
When modifying α alone, while maintaining β=1, note the coefficients' effect on recent versus older prices. Heightened overshooting needs more negative values, handled by β adjustment.
Here, changing β with a fixed α=1 shows heightened values lowering negative coefficients, boosting overshoot amplitude. Meanwhile, minimized α increases impact on recent values.
Setting α=0 simplifies the kernel equation:
1 - x^β
Such kernels lead to more conventional moving averages, demonstrated by:
For β=1, the kernel forms a linearly decreasing (WMA-like) pattern, while increased values create a rectangular (SMA-like) framework.
FAQ
Q: How can I access this Customizable Moving Average indicator? A: You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Q: What is the benefit of adjusting the lag and overshoot amplitude? A: Adjusting these parameters allows traders to tailor the moving average to their strategy, enhancing responsiveness for more timely signals or greater smoothness for trend accuracy.
Q: What are alternating extremities, and how are they useful? A: Alternating extremities highlight potential reversal points by identifying when high or low prices cross these points, aiding in decision-making for both ranging and trending markets.
Trading is risky and many will lose money in connection with trading 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 markets 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 for charting platforms, 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 or tool we provide.
Charts used on this site are by TradingView in which the majority of our tools 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.
This does not represent our full Disclaimer. Please read our full disclaimer.
© 2025 LuxAlgo Global, LLC.