Mtf Macd Trend Color Jo
- 지표
- 버전: 1.8
Multi-Timeframe (MTF) MACD Indicator with Color Trend Modes & Anti-Flicker
Overview
This is an optimized, high-performance Multi-Timeframe (MTF) MACD Custom Indicator for MetaTrader 5 (MQL5). It allows you to monitor MACD dynamics from higher timeframes (e.g., H1, H4, D1) directly on your lower timeframe execution chart without chart lag or repainting issues.
Key Features
-
Zero Repaint / Anti-Flicker: Includes an optional strict closed-bar calculation mode ( InpStrictClosed ). It locks higher-timeframe data to confirmed closed bars, eliminating bar-flicker on live ticks.
-
High Performance (Bulk Array Copy): Optimized memory handling using single-pass array copying outside execution loops to prevent CPU lag during backtesting or live execution.
-
Dual Color Modes: Visual confirmation of market bias via two customizable color logic methods.
-
Bilingual Support: Switchable label setups between English and Indonesian.
Input Parameters Guide
| Parameter | Type | Default | Description |
| InpLanguage | ENUM_LANGUAGE | LANG_ENGLISH | Set display language ( LANG_ENGLISH or LANG_INDONESIAN ). |
| InpTimeframe | ENUM_TIMEFRAMES | PERIOD_H1 | Higher target timeframe to calculate (e.g., H1, H4, D1). |
| InpFastEMA | int | 12 | Fast EMA calculation period. |
| InpSlowEMA | int | 26 | Slow EMA calculation period. |
| InpSignalSMA | int | 9 | Signal Line period. |
| InpAppliedPrice | ENUM_APPLIED_PRICE | PRICE_CLOSE | Price type used for calculations. |
| InpColorMode | ENUM_COLOR_MODE | COLOR_BY_ZERO_LEVEL | Histogram coloring methodology (see options below). |
| InpStrictClosed | bool | true | Prevents repainting/flickering by referencing fully closed HTF bars. |
Histogram Color Modes Explained
-
COLOR_BY_ZERO_LEVEL (Default)
-
Blue Bar: MACD Value $\ge 0.0$ (Bullish Territory)
-
Red Bar: MACD Value $< 0.0$ (Bearish Territory)
-
-
COLOR_BY_DIRECTION
-
Blue Bar: MACD Histogram is higher than the previous HTF bar (Rising Momentum).
-
Red Bar: MACD Histogram is lower than the previous HTF bar (Falling Momentum).
-
Installation Instructions
-
Open MetaTrader 5.
-
Go to File $\rightarrow$ Open Data Folder.
-
Navigate to MQL5 $\rightarrow$ Indicators .
-
Create or save the source code file as MACD_MTF_Custom.mq5 in this directory.
-
Open MetaEditor (press F4 ), open MACD_MTF_Custom.mq5 , and click Compile (press F7 ).
-
Return to MetaTrader 5, find the indicator under the Navigator window (Ctrl+N), and drag it onto your chart.
