PDF-MA Supertrend [BackQuant]PDF-MA Supertrend
The PDF-MA Supertrend combines the innovative Probability Density Function (PDF) smoothing with the widely popular Supertrend methodology, creating a robust tool for identifying trends and generating actionable trading signals. This indicator is designed to provide precise entries and exits by dynamically adapting to market volatility while visualizing long and short opportunities directly on the chart.
Core Feature: PDF Smoothing
At the foundation of this indicator is the PDF smoothing technique, which applies a Probability Density Function to calculate a smoothed moving average. This method allows the indicator to assign adaptive weights to data points, making it responsive to market changes without overreacting to short-term volatility.
Key parameters include:
Variance: Controls the spread of the PDF weighting. A smaller variance results in sharper responses, while a larger variance smooths out the curve.
Mean: Shifts the PDF’s center, allowing traders to tweak how weights are distributed around the data points.
Smoothing Method: Offers the choice between EMA (Exponential Moving Average) and SMA (Simple Moving Average) for blending the PDF-smoothed data with traditional moving average methods.
By combining these parameters, the PDF smoothing creates a moving average that effectively captures underlying trends.
Supertrend: Adaptive Trend and Volatility Tracking
The Supertrend is a well-known volatility-based indicator that dynamically adjusts to market conditions using the ATR (Average True Range). In this script, the PDF-smoothed moving average acts as the price input, making the Supertrend calculation more adaptive and precise.
Key Supertrend Features:
ATR Period: Determines the lookback period for calculating market volatility.
Factor: Multiplies the ATR to set the distance between the Supertrend and the price. A higher factor creates wider bands, filtering out smaller price movements, while a lower factor captures tighter trends.
Dynamic Direction: The Supertrend flips its direction based on price interactions with the calculated upper and lower bands:
Uptrend : When the price is above the Supertrend, the direction turns bullish.
Downtrend : When the price is below the Supertrend, the direction turns bearish.
This combination of PDF smoothing and Supertrend calculation ensures that trends are detected with greater accuracy, while volatility filters out market noise.
Long and Short Signal Generation
The PDF-MA Supertrend generates actionable trading signals by detecting transitions in the trend direction:
Long Signal (𝕃): Triggered when the trend transitions from bearish to bullish. This is visually represented with a green triangle below the price bars.
Short Signal (𝕊): Triggered when the trend transitions from bullish to bearish. This is marked with a red triangle above the price bars.
These signals provide traders with clear entry and exit points, ensuring they can capitalize on emerging trends while avoiding false signals.
Customizable Visualization Options
The indicator offers a range of visualization settings to help traders interpret the data with ease:
Show Supertrend: Option to toggle the visibility of the Supertrend line.
Candle Coloring: Automatically colors candlesticks based on the trend direction:
Green for long trends.
Red for short trends.
Long and Short Signals (𝕃 + 𝕊): Displays long (𝕃) and short (𝕊) signals directly on the chart for quick identification of trade opportunities.
Line Color Customization: Allows users to customize the colors for long and short trends.
Alert Conditions
To ensure traders never miss an opportunity, the PDF-MA Supertrend includes built-in alerts for trend changes:
Long Signal Alert: Notifies when a bullish trend is identified.
Short Signal Alert: Notifies when a bearish trend is identified.
These alerts can be configured for real-time notifications via SMS, email, or push notifications, making it easier to stay updated on market movements.
Suggested Parameter Adjustments
The indicator’s effectiveness can be fine-tuned using the following guidelines:
Variance:
For low-volatility assets (e.g., indices): Use a smaller variance (1.0–1.5) for smoother trends.
For high-volatility assets (e.g., cryptocurrencies): Use a larger variance (1.5–2.0) to better capture rapid price changes.
ATR Factor:
A higher factor (e.g., 2.0) is better suited for long-term trend-following strategies.
A lower factor (e.g., 1.5) captures shorter-term trends.
Smoothing Period:
Shorter periods provide more reactive signals but may increase noise.
Longer periods offer stability and better alignment with significant trends.
Experimentation is encouraged to find the optimal settings for specific assets and trading strategies.
Trading Applications
The PDF-MA Supertrend is a versatile indicator suited to a variety of trading approaches:
Trend Following : Use the Supertrend line and signals to follow market trends and ride sustained price movements.
Reversal Trading : Spot potential trend reversals as the Supertrend flips direction.
Volatility Analysis : Adjust the ATR factor to filter out minor price fluctuations or capture sharp movements.
Final Thoughts
The PDF-MA Supertrend combines the precision of Probability Density Function smoothing with the adaptability of the Supertrend methodology, offering traders a powerful tool for identifying trends and volatility. With its customizable parameters, actionable signals, and built-in alerts, this indicator is an excellent choice for traders seeking a robust and reliable system for trend detection and entry/exit timing.
As always, backtesting and incorporating this indicator into a broader strategy are recommended for optimal results.
Pdfma
Dynamic Zone Range on PDFMA [Loxx]Dynamic Zone Range on PDFMA is a Probability Density Function Moving Average oscillator with Dynamic Zones.
What is Probability Density Function?
Probability density function based MA is a sort of weighted moving average that uses probability density function to calculate the weights.
What are Dynamic Zones?
As explained in "Stocks & Commodities V15:7 (306-310): Dynamic Zones by Leo Zamansky, Ph .D., and David Stendahl"
Most indicators use a fixed zone for buy and sell signals. Here’ s a concept based on zones that are responsive to past levels of the indicator.
One approach to active investing employs the use of oscillators to exploit tradable market trends. This investing style follows a very simple form of logic: Enter the market only when an oscillator has moved far above or below traditional trading lev- els. However, these oscillator- driven systems lack the ability to evolve with the market because they use fixed buy and sell zones. Traders typically use one set of buy and sell zones for a bull market and substantially different zones for a bear market. And therein lies the problem.
Once traders begin introducing their market opinions into trading equations, by changing the zones, they negate the system’s mechanical nature. The objective is to have a system automatically define its own buy and sell zones and thereby profitably trade in any market — bull or bear. Dynamic zones offer a solution to the problem of fixed buy and sell zones for any oscillator-driven system.
An indicator’s extreme levels can be quantified using statistical methods. These extreme levels are calculated for a certain period and serve as the buy and sell zones for a trading system. The repetition of this statistical process for every value of the indicator creates values that become the dynamic zones. The zones are calculated in such a way that the probability of the indicator value rising above, or falling below, the dynamic zones is equal to a given probability input set by the trader.
To better understand dynamic zones, let's first describe them mathematically and then explain their use. The dynamic zones definition:
Find V such that:
For dynamic zone buy: P{X <= V}=P1
For dynamic zone sell: P{X >= V}=P2
where P1 and P2 are the probabilities set by the trader, X is the value of the indicator for the selected period and V represents the value of the dynamic zone.
The probability input P1 and P2 can be adjusted by the trader to encompass as much or as little data as the trader would like. The smaller the probability, the fewer data values above and below the dynamic zones. This translates into a wider range between the buy and sell zones. If a 10% probability is used for P1 and P2, only those data values that make up the top 10% and bottom 10% for an indicator are used in the construction of the zones. Of the values, 80% will fall between the two extreme levels. Because dynamic zone levels are penetrated so infrequently, when this happens, traders know that the market has truly moved into overbought or oversold territory.
Calculating the Dynamic Zones
The algorithm for the dynamic zones is a series of steps. First, decide the value of the lookback period t. Next, decide the value of the probability Pbuy for buy zone and value of the probability Psell for the sell zone.
For i=1, to the last lookback period, build the distribution f(x) of the price during the lookback period i. Then find the value Vi1 such that the probability of the price less than or equal to Vi1 during the lookback period i is equal to Pbuy. Find the value Vi2 such that the probability of the price greater or equal to Vi2 during the lookback period i is equal to Psell. The sequence of Vi1 for all periods gives the buy zone. The sequence of Vi2 for all periods gives the sell zone.
In the algorithm description, we have: Build the distribution f(x) of the price during the lookback period i. The distribution here is empirical namely, how many times a given value of x appeared during the lookback period. The problem is to find such x that the probability of a price being greater or equal to x will be equal to a probability selected by the user. Probability is the area under the distribution curve. The task is to find such value of x that the area under the distribution curve to the right of x will be equal to the probability selected by the user. That x is the dynamic zone.
Included
4 signal types
Bar coloring
Alerts
Channels fill
Pips-Stepped PDFMA [Loxx]Pips-Stepped PDFMA is and Pips-stepped moving average that uses a probability density function moving average. This is tuned for Forex. You must adjust the step size to extreme levels for this to work for crypto or stocks. Try 30000 for BTC on the daily chart, for example.
What is Probability Density Function?
Probability density function based MA is a sort of weighted moving average that uses probability density function to calculate the weights.
Included:
Bar coloring
Alerts
Expanded source types
Signals
Flat-level coloring for scalping
PDFMA Awesome Oscillator [Loxx]Theory:
Bill Williams's Awesome Oscillator Technical Indicator (AO) is a 34-period simple moving average, plotted through the bars midpoints (H+L)/2, which is subtracted from the 5-period simple moving average, built across the bars midpoints (H+L)/2. It shows us quite clearly what’s happening to the market driving force at the present moment.
This version uses PdfMA (Probability Density Function weighted Moving Average) instead of SMA (Simple Moving Average). This is a deviation from the original AO since in the AO since there is no parameter that you can change, but with this version, you can change the variance part of the PdfMA calculation. That way you can get different values for the AO even without changing periods of calculation (the general rule of thumb is: the greater the variance, the smoother the result)
Usage:
You can use color changes (mainly on zero cross) for trend change signals
ATR-Stepped PDF MA [Loxx]ATR-Stepped PDF MA is and ATR-stepped moving average that uses a probability density function moving average.
What is Probability Density Function?
Probability density function based MA is a sort of weighted moving average that uses probability density function to calculate the weights.
Included:
-Toggle on/off bar coloring
-Toggle on/off signals
-Alerts long/short