MACD Multi Timeframe Signal Alerts
- 지표
-
Allan Aparece Ninal
MetaTrader 5용 인디케이터와 전문가 어드바이저(EA)를 개발합니다.
작업 방식:
- 모든 인디케이터는 리페인팅 여부를 확인합니다. 신호는 마감된 봉에서만 결정되며, 모든 틱 테스트로 이후에 바뀌지 않는다는 것을 확인합니다.
- 모든 계산은 독립적인 기준 계산과 봉 단위로 비교합니다.
- 전략은 최적화에 사용하지 않은 데이터로 백테스트합니다. 우위가 없는 규칙은 그렇다고 분명히 밝히고 전략으로 판매하지 않습니다. - 버전: 1.0
MACD Multi Timeframe Signal Alerts is a free MT5 indicator that draws MACD from the chart's timeframe or any higher one, with a four-colour histogram. It marks a BUY or SELL when MACD crosses its signal line, marks zero-line crosses, and sends alerts.
It places no trades.
It follows the public MACD method by Gerald Appel, written in MQL5 from the formula. It runs in its own window below the chart.
Standalone: everything is built in. You do not need to install any other product named on this page.
What you see on the chart
- MACD as a soft blue line and its signal line as a thin grey line.
- The histogram (MACD minus the signal line) in four colours. Above zero: strong green while it rises, pale green while it falls. Below zero: pale red while it rises, strong red while it falls.
- A green dot on the MACD line for a BUY: MACD crosses above its signal line.
- A red dot for a SELL: MACD crosses below its signal line.
- A small mark on the zero line when MACD crosses zero, green upward and red downward.
- A matching arrow on the price chart for each BUY and SELL.
- A small label in the window: the timeframe used, the histogram's state, and the latest signal with its age.
The colours are soft mid-tones that read on dark and light charts.
Higher timeframe without repainting
Set Timeframe to H4 on an H1 chart and the window shows the H4 MACD. A chart bar shows the newest H4 bar that has closed when the chart bar closes. The line steps once per H4 bar, on the H1 bar that completes it, and stays there.
Many multi-timeframe indicators show the forming higher-timeframe bar on older chart bars, so their history looks better than it was live. This one never does: what you see on a past bar is what it showed at that bar's close.
How the signal is built
MACD is the 12-bar EMA of the close minus the 26-bar EMA. The signal line is the 9-bar EMA of MACD (or an SMA, as in MetaTrader's own MACD). The histogram is the gap between them.
Everything is decided at the close of a bar. A dot, arrow or alert appears on the bar that closed with the cross. It never moves afterwards.
Who it is for
For traders who read MACD on a higher timeframe while they trade a lower one, and for those who know the four-colour MACD from TradingView.
Not for you if you want a ready-made trading system. MACD crosses often, and you decide which crosses matter.
Inputs
| Input | Default | Description |
|---|---|---|
| Timeframe | current | the chart's own, or a higher one up to W1. A lower one falls back to the chart's. |
| Fast EMA / slow EMA / signal line length | 12 / 26 / 9 | - |
| Signal line average | EMA | EMA (TradingView) or SMA (MetaTrader's MACD). |
| BUY only below zero, SELL only above zero | off | when on, a cross on the other side gets only a small grey dot. |
| Mark crosses the zero filter skipped | on | - |
| Mark zero-line crosses | on | - |
| Alert on zero-line crosses too | on | - |
| Arrows on the price chart | on | for BUY and SELL, on the last 2000 bars. |
| Arrow colours | blue / red | - |
| State label in the window | on | - |
| Pop-up | on | - |
| Sound | off (file alert.wav) | - |
| Push | on | - |
| off | - | |
| Debug log for bug reports | off | see Found a problem? |
How often
Per month per symbol with the defaults (EURUSD, GBPUSD, USDJPY, XAUUSD, BTCUSD, closed bars, 2024 to 2026; a code count, not a trading result). BUY and SELL together: M15 about 152 to 234, H1 about 37 to 55, H4 about 9 to 14, D1 about 1 to 2. Zero-line crosses: M15 about 67 to 106, H1 about 16 to 25, H4 about 4 to 7, D1 about 1. With a higher timeframe set, the counts are those of that timeframe.
Alerts and Expert Advisor use
One alert per closed bar, never while the history loads. The message says BUY or SELL (and the zero cross, if any), the timeframe used and the close. For push alerts, set your MetaQuotes ID under Tools, Options, Notifications.
Buffers for Expert Advisors: 2 is MACD, 3 is the signal line, 0 is the histogram and 1 its colour (0 to 3). Buffer 7 holds MACD on a BUY bar and buffer 8 on a SELL bar. Buffers 11 and 12 hold 0 on a zero cross up and down. They are empty otherwise.
How it was checked
Code check: an independent Python version was compared bar by bar with MACD, the signal line, the histogram colour and every signal and zero cross. It ran on EURUSD, GBPJPY, XAUUSD and BTCUSD at M15, H1 and H4 with four input sets, two of them with a higher timeframe (H4 and D1). All 48 files matched (147,755 signals and zero crosses).
Code check: an every-tick run on EURUSD H1 with the H4 MACD (10.4 million ticks, 4,644 closed bars). No MACD or signal-line value and no signal changed after its bar closed, and no signal showed on the live bar.
Works well with
These are workflow suggestions. I have not found that any pair gives better trading results. You do not need any of them.
| Product | How to use them together | Why |
|---|---|---|
| Risk Position Tool | Pick the trade from the chart, then drag the entry and stop lines. The tool gives the lot for your risk. | It separates where you enter from how much you risk. The tool places no orders. |
| Session Levels | Add it to the same chart. | It draws session boxes, killzones and previous day and week levels as context. It is not a signal. |
| Divergence Signal Alerts | Add it to the same chart. | It marks RSI and MACD divergences against price, a second view of the same momentum. |
| WaveTrend Signals | Add it to the same chart. | It marks WT1 and WT2 crosses in the overbought and oversold zones, another view of momentum. |
| Indicator Arrow Trader | Name this indicator and the buffers that hold its signals in the EA. | The EA trades the signals of an indicator you choose, on the closed bar, with a stop loss and a fixed 0.01 lot. Test it on a demo account first. |
| Repaint and Signal Scorecard | Name this indicator and the buffers that hold its signals in the scorecard. | It checks whether those signals repaint and how they did on the chart's history. It places no trades. |
Questions
Does it repaint? The lines of the forming bar move with price. Once a bar has closed, its values, dots, arrows and alerts do not change. With a higher timeframe, a chart bar shows only higher-timeframe bars that had closed by then.
Why does the line look like steps with a higher timeframe? Each step is one closed higher-timeframe bar. A smooth line would need the forming bar, which changes until it closes.
Why does it differ a little from another MACD? Versions differ in how the averages start and in the signal line (EMA or SMA). Here the EMAs start from the average of their first bars, as on TradingView.
Does it work in the Strategy Tester? Yes, in visual mode, on any symbol.
Does it work on gold and crypto? Yes, on any symbol and timeframe.
Will I get alerts on my phone? Yes, push is on by default. Set your MetaQuotes ID.
Is there a MetaTrader 4 version? Yes, MACD Multi Timeframe Signal Alerts MT4, with the same inputs and signals.
Custom work
Want an EA that trades this indicator, a custom version of it, or a new indicator or EA of your own? Order it through MQL5 Freelance and choose me as the developer: order through Freelance. Send your requirements, rules and the flow or algorithm you want. The whole order, payment and delivery stay inside MQL5 Freelance.
Found a problem?
- In the inputs, set "Debug log for bug reports" to true.
- Repeat what went wrong.
- Open the Experts tab in the Toolbox. Copy the lines that start with "DBG" and paste them in a comment on this page, with the symbol and timeframe.
- Set the debug log back to false.
The debug lines never contain your account number, name, server, balance or equity.
If it helps your trading, a short review on this page helps other traders find it.
Questions: use the comments on this page or send me a message on MQL5.
The defaults are a starting point. An indicator does not predict price, and trading carries a risk of loss.
