OPEN-SOURCE SCRIPT

Edo HMA Core

344
Edo HMA Core — Clean Trend Reading Built on the Hull Moving Average with Slope, State, Fast Acceleration, Inflexion Markers and Information Panel

The Hull Moving Average was introduced by Alan Hull in 2005 to solve the permanent dilemma of classical moving averages: the smoother the average, the more lag; the faster the average, the more noise. By combining three weighted moving averages with mathematically derived lengths, the HMA produces a curve that is visually smooth but reacts to price flips with significantly less lag than an equivalent EMA or SMA.

Edo HMA Core takes that original idea and turns it into a complete trend indicator. On its own, an HMA is just a line. With Edo HMA Core, that line gains state colour, a percentage slope reading, an automatic inflexion detector, a translucent state fill between price and average, and a second faster HMA that adds an acceleration reading. Five coordinated layers on a single overlay, designed to keep the visual purity of a moving average while delivering far richer information about the regime of the asset.


THREE HMA VARIANTS

A single dropdown selects between three Hull constructions:

— Standard — Alan Hull's original three-WMA formula. Balanced, default option. Recommended for 4H, daily and weekly charts.
— Exponential (EHMA) — Variant built with EMA instead of WMA. Slightly smoother and slower to react. Useful on highly volatile assets or low timeframes.
— Triple (THMA) — Variant using three WMAs with 1/3, 1/2 and full lengths weighted for sharper turns. Most reactive variant, useful for early inflexion detection at the cost of a small noise increase.

The three variants share plots, markers and panel — only the calculation engine of the line changes.


SLOPE AND STATE CLASSIFICATION

Slope is calculated as the difference between the current HMA value and its value a few bars back:

slope = HMA − HMA[lookback]

The Slope Lookback parameter (default 2) controls how reactive the reading is. Low lookbacks catch turns earlier; high lookbacks filter noise.

Based on the sign of the slope, the indicator assigns one of three states:

— Trend Up — Slope > 0. Main HMA, fast HMA and fill turn green.
— Trend Down — Slope < 0. Main HMA, fast HMA and fill turn red.
— Flat — Slope = 0. Lines turn neutral teal.

The colour system is consistent across every visual element, so the regime is readable at a glance without needing to look at the panel.


FAST HMA AND ACCELERATION CROSSES

A second HMA is calculated with a shorter length (21 by default), sharing type and source with the main. The relationship between fast and main is read as an acceleration measure:

— Fast above main → recent momentum accelerating relative to the underlying trend
— Fast below main → recent momentum decelerating or reversing

Each cross is automatically marked with an X-cross: green below the candle for a Fast Cross Up, red above the candle for a Fast Cross Down. These are acceleration signals, not trend-change signals — for that, the indicator provides explicit inflexion triangles.


INFLEXION MARKERS

The most structural signals of the indicator. Every time the main slope changes sign, the indicator draws a triangle:

— Flip Up (▲) — Green triangle below the candle when slope crosses from negative to positive. Start of a new bullish regime.
— Flip Down (▼) — Red triangle above the candle when slope crosses from positive to negative. Start of a new bearish regime.

Every flip is accompanied by a simultaneous update of the HMA colour, fast HMA colour and state fill.


PRICE / HMA CROSSES AND STATE FILL

Direct crosses of price with the main HMA do not produce visual markers (to keep the chart clean) but are available as alert conditions:

— Price Crossed Above HMA — close reclaims the main HMA. Bullish reclaim.
— Price Crossed Below HMA — close loses the main HMA. Loss of dynamic support.

Between price and HMA the indicator draws a translucent fill whose colour matches the active state. Fill Opacity is configurable from 50 (very opaque) to 99 (almost invisible), default 85. The fill provides an immediate state reading and makes the magnitude of the price/HMA separation visible at all times.


INFORMATION PANEL

A five-field panel summarises the current regime in real time:

— State — Trend Up / Trend Down / Flat
— Slope — current slope as a percentage of the HMA value (e.g. +4.402%, −0.739%)
— Price vs HMA — distance of price from the HMA as a percentage (e.g. +50.25%, −13.00%)
— Fast — relative position of the fast HMA versus main (Fast > Slow, Fast < Slow, Off)
— Type — current variant and length (e.g. Standard - 55)

Numeric fields are coloured according to the active state. The panel can be placed in any of the four chart corners and resized to Small or Medium. Dark and Light themes adapt the panel to the chart background.


CONFIGURATION

— Hull MA: HMA Length (default 55), HMA Type (Standard / Exponential / Triple), Source (default close), HMA Line Width (1-5)
— Fast Cross: Show Fast HMA Cross, Fast HMA Length (default 21), Fast HMA Width (1-4)
— State: Show Inflexion Markers, Slope Lookback in bars (1-10), Fill Between Price and HMA, Fill Opacity (50-99)
— Style: Bull Color, Bear Color, Neutral Color, Theme (Dark / Light)
— Panel: Show Panel, Panel Position (four corners), Panel Size (Small / Medium)


ALERTS

Six predefined alert conditions cover every meaningful event:

— HMA Flip Up — slope crosses from negative to positive
— HMA Flip Down — slope crosses from positive to negative
— Fast Cross Up — fast HMA crosses above main
— Fast Cross Down — fast HMA crosses below main
— Price Crossed Above HMA — close reclaims the main HMA
— Price Crossed Below HMA — close loses the main HMA

All alerts evaluate on bar close in the active timeframe. The two inflexion alerts work well for medium and long-term position management; the two fast crosses are common in active management; the two price/HMA alerts confirm breaks of the average in mature trends.


HOW TO READ IT

A clean reading combines the five layers into common patterns.

Clean bullish reactivation — After prolonged Trend Down, a Flip Up appears, price reclaims the HMA, the fast crosses above the main and the fill switches from red to green. The cleanest sequence for confirming a new bullish regime.

Bullish exhaustion — In a sustained Trend Up, slope shrinks while price keeps advancing. A Fast Cross Down appears before any slope change. Usually precedes a Flip Down.

Bearish capitulation — In an advanced Trend Down, a Fast Cross Up appears inside the red fill. If price then reclaims the HMA and slope turns, a Flip Up arrives.

Sideways noise — In flat zones, slope crosses zero repeatedly and alternating flips appear within a few bars. Raise Slope Lookback to 5+ bars to filter non-structural flips.


OPEN SOURCE

Edo HMA Core is published as a free open source indicator. The full Pine Script is publicly accessible on TradingView for study, adaptation and integration into any workflow. Part of the Edolab Markets free tools ecosystem alongside Edo SuperTrend Core, Edo EMA Core Cross, Edo Sentiment Map, Edo TRIX Core Cross, Edo RSI Dual, Edo Multi Stoch, Edo A/D Flow Core, Edo Liquidity Zones, Edo ZigZag Auto Fib SR and Edo Bands Fusion.


This indicator is a technical analysis tool for educational and informational purposes only. It does not generate automatic buy or sell signals and should not be considered financial advice. Trading financial markets involves significant risk of capital loss. Past performance does not guarantee future results. Always use proper risk management.

כתב ויתור

המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.