PDF-MA Supertrend
Jan 23, 2025

The PDF-MA Supertrend indicator combines innovative Probability Density Function (PDF) smoothing with the traditional Supertrend methodology to provide a reactive trend-following tool. By applying adaptive weights to data points, it aims to deliver precise trend identification and actionable signals while filtering out market noise.
Usage
The PDF-MA Supertrend is used to identify the prevailing market direction and potential entry or exit points based on volatility-adjusted price movements. Unlike a standard Supertrend that uses raw price data, this tool uses a PDF-smoothed moving average as its primary input, resulting in smoother transitions and reduced false signals during choppy price action.
- Trend Identification: When the price is above the Supertrend line, the trend is considered bullish (represented by green visuals). When the price is below the Supertrend line, the trend is considered bearish (represented by red visuals).
- Signal Generation: The script automatically plots "𝕃" (Long) and "𝕊" (Short) labels when the trend direction flips. A green triangle below the bar indicates a bullish transition, while a red triangle above the bar indicates a bearish transition.
- Candle Coloring: Users can enable trend-based candle coloring to maintain a clear visual perspective of the current market regime without needing to focus solely on the indicator line.
Details
The indicator is built upon two main mathematical components:
- PDF Smoothing: This technique calculates a moving average by assigning weights based on a Gaussian distribution (Probability Density Function). By adjusting the variance and mean, the indicator can be tuned to prioritize specific data points within the lookback window, making it more responsive or more stable than a standard SMA or EMA.
- Supertrend Logic: The script calculates upper and lower volatility bands using the Average True Range (ATR). The direction flips whenever the price closes across the current band, creating a dynamic trailing stop or trend baseline.
Settings
Calculation Settings
- Price Source: Determines the price data used for the smoothing calculation (e.g., Close, HL2).
- Smoothing Method: Choose between EMA or SMA to blend with the PDF-smoothed results.
- Smoothing Period: The lookback window for the moving average calculation.
- PDF Variance: Controls the spread of the weighting; lower values make the average more reactive to recent changes.
- PDF Mean: Shifts the center of the weighting distribution.
Supertrend
- ATR Period: The lookback period used to calculate market volatility.
- Factor: The multiplier for the ATR; higher values result in a wider, more conservative trend line.
UI Settings
- Show Supertrend on chart?: Toggles the visibility of the main trend line.
- Paint candles according to Trend?: Enables or disables trend-based candle coloring.
- Show Long and Short Signals: Toggles the "𝕃" and "𝕊" labels.
- Long/Short Color: Customizes the colors used for bullish and bearish trends.
FAQ
How do I access PDF-MA Supertrend?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
What is the advantage of PDF smoothing over a normal MA?
PDF smoothing allows for adaptive weighting, meaning the indicator can be fine-tuned to be more responsive to price changes without the lag or "jaggedness" often found in traditional moving averages.
Which assets does this indicator work best on?
The indicator is versatile but performs best on trending assets. For high-volatility assets like crypto, a higher ATR factor and PDF variance are generally recommended to filter out noise.
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.