OPEN-SOURCE SCRIPT

Advanced Fractal and Hurst Indicator

Advanced Fractal and Hurst Indicator (AFHI)

Description:

The Advanced Fractal and Hurst Indicator (AFHI) is a custom technical analysis tool designed to identify market trends and potential reversals by leveraging the concepts of Fractal Dimension and the Hurst Exponent. These advanced mathematical concepts provide insights into the complexity and persistence of price movements, making this indicator a powerful addition to any trader's toolkit.

How It Works:
Fractal Dimension (FD):
  • The Fractal Dimension measures the complexity of price movements. A higher Fractal Dimension indicates a more complex, choppy market, while a lower value suggests smoother trends.
  • The FD is calculated using the log difference of price movements over a specified length.

*Hurst Exponent (HE):
  • The Hurst Exponent indicates the tendency of a time series to either regress to the mean or cluster in a direction. Values below 0.5 indicate a tendency to revert to the mean (mean-reverting), while values above 0.5 suggest a trending market.
  • The HE is calculated using the rescaled range method, comparing the range of price movements to the standard deviation.

*Composite Indicator:
  • The Composite Indicator combines the smoothed Fractal Dimension and Hurst Exponent to provide a single value indicating market conditions. This is done by normalizing the FD and HE values and combining them into one metric.
  • A positive Composite Indicator suggests an uptrend, while a negative value indicates a downtrend.

*Smoothing:
  • Both FD and HE values are smoothed using a simple moving average to reduce noise and provide clearer signals.

*Trend Confirmation:
  • A 50-period moving average (MA) is used to confirm the trend direction. The price being above the MA indicates an uptrend, while below the MA indicates a downtrend.

*Background Shading:
  • The indicator pane is shaded green during uptrend conditions (positive Composite Indicator and price above MA) and red during downtrend conditions (negative Composite Indicator and price below MA).


How Traders Can Use It:
*Identifying Trends:
  • Traders can use the AFHI to identify current market trends. The background shading in the indicator pane provides a visual cue for trend direction, with green indicating an uptrend and red indicating a downtrend.

Trend Confirmation:
  • The Composite Indicator line, plotted in purple, helps confirm the trend. Positive values suggest a strong uptrend, while negative values indicate a strong downtrend.

*Entry and Exit Signals:
  • Traders can use the transitions of the Composite Indicator and the background shading to time their entry and exit points. For instance, a shift from red to green shading suggests a potential buy opportunity, while a shift from green to red suggests a potential sell opportunity.

Alerts:
  • The script includes alert conditions that can notify traders when the Composite Indicator signals a new trend direction. Alerts can be set up for both uptrends and downtrends, helping traders stay informed of key market changes.

Strategy Development:
  • By integrating AFHI into their trading strategies, traders can develop more robust systems that account for market complexity and persistence. The indicator can be used alongside other technical tools to enhance decision-making and improve trade accuracy.

fractaldimensionhurstexponentindicatorsmarkettrendsMoving AveragesTechnical AnalysistradingstrategyTrend Analysis

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?


Also on:

Disclaimer