Multi EMA Trend Set
- Indicatori
- Rahib Samadov
- Versione: 1.0
This MQL5 indicator draws four Exponential Moving Averages (EMAs) — 21, 50, 100, and 200 — directly on the chart window.
The EMA 21 is displayed as a color-changing line, while EMA 50, 100, and 200 are standard single-color lines.
The color of EMA 21 changes dynamically based on price position.
When the closing price is above EMA 21, the line turns blue, indicating bullish pressure.
When the closing price is below EMA 21, the line turns yellow, indicating bearish pressure.
If the price equals EMA 21, the indicator keeps the previous color to avoid flickering.
The indicator uses five buffers, including a dedicated color buffer for EMA 21.
Each EMA is calculated using the built-in iMA function with the EMA method and closing price.
A toggle button is created on the chart that allows the user to show or hide all EMA lines.
Clicking the button switches between displaying the EMAs and hiding them completely.
The button text updates dynamically to reflect the current state (Show or Hide EMAs).
The button can be dragged with the mouse and is positioned in the top-right corner of the chart.
During each calculation cycle, the indicator updates EMA values using CopyBuffer .
Overall, this indicator provides a clean multi-EMA trend view with interactive control and visual trend confirmation through EMA 21 color changes.
