HA Flow Mean
- Indicatori
-
Paolo Ruffini
Sono un trader con oltre 15 anni di esperienza operativa sui mercati Forex e materie prime, con particolare focus su dinamiche di liquidità, pressione volumetrica e struttura del movimento direzionale. - Versione: 1.11
HA Flow Mean
HA Flow Mean is a free adaptive equilibrium indicator for MetaTrader 5. It brings candle structure, directional persistence and smoothing together in one color-coded line on the main price chart. An optional information panel provides a clear summary of the most recently closed candle.
What the indicator measures
The calculation combines three elements of each candle: the direction and relative size of its real body, the imbalance between its upper and lower wicks, and the position of its closing price within the high-low range. These contributions produce a dynamic equilibrium value.
The indicator then adjusts its response using directional persistence and changes in candle range. A soft noise filter attenuates small changes, while an adaptive smoothing stage and a final smoothing stage produce the displayed line. Its volatility estimate is a smoothed high-low range, not Average True Range (ATR).
Main features
- A single adaptive equilibrium line displayed directly on the price chart.
- Three customizable flow colors: bullish, neutral and bearish.
- Adjustable sensitivity to candle bodies, wicks and closing pressure.
- Three volatility response modes: DAMPEN, NEUTRAL and BOOST.
- Color hysteresis to reduce frequent transitions close to the neutral threshold.
- An optional panel with dark and light appearance settings.
- No trading operations, DLL dependencies or external indicator requirements.
How to read the line and panel
Turquoise: bullish flow. Gray: neutral flow. Coral: bearish flow. The flow classification combines the line slope with filtered candle pressure; color is not determined by slope alone. The colors can be changed in the inputs.
The panel displays the flow state and equilibrium value for the most recently closed candle, together with the current symbol, timeframe and memory setting. The current-candle line remains live, so its value or color may differ from the closed-bar summary.
Use the line as visual context for price structure and changes in directional pressure. A color transition is an analytical observation, not an automatic instruction to enter or exit a trade.
Calculation behavior
- The value and color on the current candle update as price changes and may change before the candle closes.
- Closed-bar calculations do not use future candles. Loading deeper history or changing settings can alter values because the filters are recursive.
- The first 3 × FlowMemory bars are hidden to reduce the visual impact of initialization. This is a display warm-up period, not a guarantee of full mathematical convergence.
- With the default FlowMemory of 21, the panel requires at least 65 bars. It displays an insufficient-history message when this requirement is not met.
- Despite its name, HA Flow Mean uses the chart's open, high, low and close data. It does not internally generate a separate Heikin Ashi candle series.
Inputs: memory and response
- FlowMemory — 21: base memory length in bars. Higher values generally produce a slower response. Accepted range: 2 to 100000.
- Response — 0.90: positive multiplier controlling the adaptive response intensity. Increasing it generally makes the line more responsive, subject to the internal limits and smoothing.
- Persistence — 3: smoothing length for directional persistence. Minimum: 1. It is not a requirement for a fixed number of consecutive candles.
Inputs: candle balance
- BodyWeight — 1.00: nonnegative weight applied to the real candle body contribution.
- WickWeight — 0.40: nonnegative weight applied to the imbalance between lower and upper wicks.
- ClosePressureWeight — 0.80: nonnegative weight applied to the closing price's position within the candle range. Candles with no high-low range have zero closing-position pressure.
Inputs: smoothing filters
- NoiseThreshold — 0.12: nonnegative soft-filter threshold relative to the reference candle range. Higher values attenuate small equilibrium changes more strongly. This input also influences the neutral color zone.
- VolatilityResponse — DAMPEN: selects the response to candles whose range exceeds the reference. DAMPEN attenuates the response; NEUTRAL leaves the volatility multiplier unchanged; BOOST increases the response.
- VolatilityStrength — 0.60: nonnegative strength of DAMPEN or BOOST. It has no effect on the volatility multiplier in NEUTRAL mode.
- AlphaSmoothing — 0.25: update speed of the adaptive smoothing coefficient. Accepted values are greater than 0 and no greater than 1. Lower values change the coefficient more gradually.
- FinalSmoothing — 0.35: update speed of the final line filter, using the same valid range. Lower values produce more smoothing and additional lag.
Inputs: appearance
- LineWidth — 3: line thickness, displayed within the range 1 to 5.
- BullishColor: color for bullish flow; turquoise by default.
- NeutralColor: color for neutral flow; gray by default.
- BearishColor: color for bearish flow; coral by default.
- ColorHysteresis — 0.15: transition stabilization from 0 to 1. Higher values widen the separation between entering and leaving a directional state. Set to 0 to disable hysteresis.
- ShowPanel — true: show or hide the information panel.
- PanelX — 16: nonnegative horizontal panel offset in pixels from the left chart edge.
- PanelY — 40: nonnegative vertical panel offset in pixels from the top chart edge.
- DarkPanelTheme — true: use the dark panel appearance. Set to false for the light appearance. The chart's own theme is not changed.
Getting started
- Attach HA Flow Mean to a MetaTrader 5 chart and begin with the default inputs.
- Allow sufficient price history to load.
- Choose the panel appearance and position that suit your chart. Give multiple instances different panel positions to avoid overlap.
- Observe both the live line and the last-closed-candle panel before adjusting sensitivity.
- Change one parameter at a time and evaluate its effect on the symbol and timeframe you use.
HA Flow Mean analyzes the current chart symbol and timeframe. It is not a multi-symbol scanner or a multi-timeframe overlay. It does not place or manage orders, send trade alerts, or promise profitable results.
