L1 An Adaptive Moving Average For Swing Trading
Apr 19, 2023

The L1 An Adaptive Moving Average For Swing Trading indicator provides a responsive and smooth trend-following tool designed to adapt to market volatility for improved swing trading entries and exits.
Usage
The Usage section describes how the script can be used to identify market trends and potential reversal points. This indicator functions as an advanced smoothing mechanism that reacts more quickly than a standard Simple Moving Average (SMA) during volatile periods while remaining smooth during consolidations.
- Trend Identification: When the Adaptive AMA (fast line) is above the Adaptive AMA Trigger (slow line), the market is considered to be in an uptrend, often visualized by a green fill. Conversely, when the fast line is below the slow line, the market is in a downtrend, visualized by a red fill.
- Signal Execution: The script plots "Buy" and "Sell" labels based on crossovers between the adaptive moving average and its historical values. A "Buy" label appears when the trend turns positive and a crossover occurs, while a "Sell" label appears when the trend turns negative and a crossunder occurs.
- Swing Trading: Traders can use the space between the primary AMA and its trigger line to gauge trend strength. A widening gap suggests increasing momentum, while a narrowing gap may signal a potential trend exhaustion.
Details
The script is based on the methodology introduced by Scott Cong in the April 2023 article "An Adaptive Moving Average For Swing Trading." It builds upon the concepts of Perry Kaufman’s Adaptive Moving Average (AMA) by modifying how the smoothing factor (alpha) is calculated.
The core logic utilizes the relationship between the price range (Highest High - Lowest Low) and the total "effort" (Sum of True Range) over a specific lookback period.
- Alpha Calculation: The smoothing factor is derived by dividing the price range by the total effort. This ensures that in trending markets (where the range is a large portion of the total movement), the indicator becomes more responsive.
- Smoothing Factor: If the total effort is zero or the price range equals the effort, the indicator defaults to the current price. In all other scenarios, it applies the calculated alpha to create a moving average that balances noise reduction with lag minimization.
Settings
- Length: Sets the lookback period (default 14) used to calculate the price range and total effort. Higher values result in a smoother, slower line, while lower values increase sensitivity.
- Price: Determines the source data for the calculation (default hl2). Users can switch this to close, open, hlc3, or other price sources depending on their strategy needs.
FAQ
How do I interpret the Buy and Sell labels? The labels appear when the adaptive average crosses its previous value while simultaneously being on the correct side of the trigger line, signifying a confirmed shift in momentum.
Can I use this indicator for intraday trading? While designed for swing trading, the adaptive nature of the smoothing factor allows it to function across various timeframes, including intraday charts, by adjusting to the specific volatility of that period.
How can I access this tool? 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.