Price to MA Distance Histogram
- Indicatori
- Versione: 1.10
- Attivazioni: 5
Version 1.10 for MetaTrader 4
Overview
Price to EMA Mean Histogram is a separate-window oscillator that expresses the distance between price and a configurable moving-average mean as a percentage. It combines a close-price histogram, candle-extreme shadows, dynamic reference levels, and an optional fast EMA line in one compact view.
The default configuration uses EMA 50 as the mean and EMA 14 as the fast reference.
Visual Elements
-
Bright bullish histogram: candle close is at or above the mean.
-
Bright bearish histogram: candle close is below the mean.
-
Dark shadow histogram: the relevant candle extreme relative to the mean.
-
Zero line: the location of the configured mean.
-
Dynamic level lines: symmetric percentage-distance references that appear as price approaches or exceeds them.
-
Fast EMA line: the fast EMA's percentage distance from the configured mean.
The colors are descriptive only. They do not constitute buy or sell signals.
Inputs
| Input | Default | Description |
|---|---|---|
| MeanMAPeriod | 50 | Period of the moving-average mean. |
| MeanMAMethod | EMA | Moving-average method used for the mean. |
| MeanAppliedPrice | Close | Applied price used by the mean. |
| LevelStepPercent | 0.05 | Percentage spacing between reference levels. |
| NumberOfLevels | 6 | Number of level pairs to display, from 0 to 6. |
| LevelProximityPercent | 0.01 | Distance before a level at which that level becomes visible. |
| UseClosedBarOnly | false | Mirrors the last closed bar onto the live bar to prevent intrabar visual changes. |
| BullColor | Lime Green | Color of closes above the mean. |
| BearColor | Tomato | Color of closes below the mean. |
| ShadowBullColor | Dark Green | Color of upper extremes above the mean. |
| ShadowBearColor | Maroon | Color of lower extremes below the mean. |
| ZeroColor | Silver | Color of the zero line. |
| LevelColor | Dim Gray | Color of the dynamic reference levels. |
| ShowFastEMA | true | Shows or hides the fast EMA reference line. |
| FastEMAPeriod | 14 | Period of the fast EMA. |
| FastEMAColor | White | Color of the fast EMA reference line. |
| MainHistWidth | 3 | Width of the main histogram, from 1 to 5. |
| ShadowHistWidth | 1 | Width of the shadow histogram, from 1 to 5. |
| LevelStyle | Dotted | Line style of the dynamic reference levels. |
Interpretation
-
Values above zero show that price is above the configured mean.
-
Values below zero show that price is below the configured mean.
-
Expanding absolute distance indicates increasing separation from the mean.
-
Contracting absolute distance indicates price or the fast EMA is moving back toward the mean.
-
Repeated zero-line crossings can indicate a less directional or more rotational market.
-
Outer dynamic levels provide context for unusually extended movement, but they are not fixed overbought or oversold signals.
Notes
-
The indicator does not open, modify, or close trades.
-
The current bar can change on every tick when UseClosedBarOnly is disabled.
-
When UseClosedBarOnly is enabled, all plots on bar 0 mirror bar 1.
-
The moving-average method is configurable even though the default and product name use EMA.
-
Reference-level behavior depends on the instrument, timeframe, and volatility regime. Test suitable values before using the indicator in a trading workflow.
Version 1.10
-
Standardized the source code and documentation in English.
-
Removed inline annotations from input declarations.
-
Added typed moving-average and line-style inputs for clearer selection menus.
-
Added validation for periods, level settings, and plot widths.
-
Made the fast EMA plot label follow the selected period.
-
Applied closed-bar mode consistently to every visual plot.
-
Preserved the original distance and dynamic-level calculations.
Disclaimer
This indicator is provided for analytical and educational purposes. It does not guarantee future performance and should not be treated as financial advice.
