Login Sign Up
XAUUSD3,627.30▼ -0.73% XAGUSD43.015▼ -1.67% EURUSD1.09373 BTCUSD58,795.02▼ -2.30% GBPUSD1.33941▲ 0.94%· Tue 09:00 USDJPY158.673▼ -0.55%· Tue 09:00 US3046,214.3▲ 1.33%· Mon 19:30 US5006,581.8▲ 1.13%· Mon 19:30 GER4025,325.7▼ -0.35%· Thu 09:41 AUDUSD0.69697▲ 0.38%· Tue 09:00 USDCAD1.37411▼ -0.04%· Tue 09:00
Free Indicator MT4MT5 v1.01

SGT MACD Pro

SGT MACD Pro shows the MACD line, the SMA signal line and a four-color histogram in a separate sub-window, and marks BUY and SELL signals on the main chart only after a candle has closed, with Entry, Stop Loss and …

SGT MACD Pro MT5 indicator on an H4 gold XAUUSD chart with the MACD, SMA signal line and four-color histogram in the sub-window, a BUY box with Entry, SL and TP lines extending to the current bar, and the Investor Tipster panel

About

SGT MACD Pro is a free, original Investor Tipster tool. The MACD calculation follows the same rules as ChrisMoody's multi-timeframe MACD study on TradingView: MACD is the fast EMA minus the slow EMA of the close (defaults 12 and 26), and the signal line is an SMA of the MACD (default 9), not an EMA. The code is written from scratch for MT4 and MT5. It reads closed candles for its signals, so a BUY or SELL mark never repaints.

What it shows

  • MACD line and signal line (sub-window): MACD = fast EMA − slow EMA of the close. The signal line is an SMA of the MACD (default 9). By default the MACD line changes color when it is above or below the signal line.
  • Four-color histogram: MACD minus the signal line. Four colors: above zero rising, above zero falling, below zero falling, below zero rising.
  • Cross dots: a dot on the MACD line when it crosses the signal line.
  • Other timeframe (optional, off by default): MACD can be calculated on a chosen timeframe instead of the chart. Each chart bar uses the last bar of that timeframe that had already closed when the chart bar closed, so there is no look-ahead.
  • BUY / SELL on closed candles only: the arrow and filled box on the main chart, with Entry, Stop Loss and Take Profit lines.

Signals. BUY: on a closed candle, the MACD line crosses above the signal line. SELL: the MACD line crosses below the signal line. Entry is the close of the signal candle. Stop Loss is ATR(14) x 1.5 away from the entry, or beyond the recent swing (your choice). Take Profit is the stop distance times the chosen R multiple. Default is 2R (the original default, faithful to the TradingView study). A tested 3R option is also available; the input label says it is for H1 / D1 only and to use 2R on H4. A custom multiple can be typed as well. Older signals' Entry, Stop Loss and Take Profit lines end at the bar where the stop or target would have been reached. The latest signal's lines stay drawn to the current bar until a new signal appears.

Panel. The boxed panel (default: bottom left) shows whether MACD is above or below the signal (and the timeframe if another one is in use), the histogram direction, the last signal with date, time and price on its own line, Entry, Stop Loss, Take Profit, the signal status, and "License: Free". Click the header to collapse it.

Works on any symbol and timeframe your broker offers, including gold (XAUUSD) and forex pairs. This is a technical study tool. It does not guarantee results. Test it on a demo chart first.

Footer on the panel: Investor Tipster · investortipster.com · SGT · smartgoldtrade.com

User manual

Install, inputs, panel, FAQ

SGT MACD Pro is a free MT4 and MT5 indicator (version 1.01). There is no license key and it makes no internet connection. It shows the MACD line, the SMA signal line and a four-color histogram in a separate sub-window and marks BUY and SELL signals on the main chart on closed candles only, with Entry, Stop Loss and Take Profit lines. The MACD math follows ChrisMoody's multi-timeframe MACD study (signal = SMA 9). It is a technical analysis tool and does not promise any result.

What you get

  • MACD line and signal line (sub-window): MACD = fast EMA − slow EMA of the close (defaults 12 and 26). The signal line is an SMA of the MACD (default 9), not an EMA. By default the MACD line changes color when it is above or below the signal line.
  • Four-color histogram: MACD minus the signal line. Four colors: above zero rising, above zero falling, below zero falling, below zero rising.
  • Cross dots: a dot on the MACD line when it crosses the signal line.
  • Other timeframe (optional, off by default): MACD can be calculated on a chosen timeframe instead of the chart. Each chart bar uses the last bar of that timeframe that had already closed when the chart bar closed, so there is no look-ahead.
  • BUY / SELL on closed candles only: the arrow and filled box on the main chart, with Entry, Stop Loss and Take Profit lines.

Install on MT4

  1. In MetaTrader 4, choose File -> Open Data Folder.
  2. Open MQL4/Indicators/.
  3. Copy SGT_MACD_Pro.ex4 into that folder.
  4. In the Navigator, right-click Indicators and choose Refresh, or restart the terminal.
  5. Open a chart (for example XAUUSD H1) and drag SGT MACD Pro onto it. It opens its own sub-window.
  6. Set the inputs if you want, then click OK. No DLL permission, WebRequest setting or key is needed.

Install on MT5

  1. In MetaTrader 5, choose File -> Open Data Folder.
  2. Open MQL5/Indicators/.
  3. Copy SGT_MACD_Pro.ex5 into that folder.
  4. In the Navigator, right-click Indicators and choose Refresh, or restart the terminal.
  5. Open a chart and attach SGT MACD Pro. It opens its own sub-window.
  6. Set the inputs if you want, then click OK. No DLL permission, WebRequest setting or key is needed.

How to read it

  • MACD and signal lines: the MACD line (default: green above the signal, red below it) and the gold SMA signal line in the sub-window.
  • Histogram: MACD minus the signal. Bright green: above zero and rising. Dark green: above zero but falling. Bright red: below zero and falling. Dark red: below zero but rising.
  • Cross dots: a dot appears on the MACD line when it crosses the signal line.
  • BUY / SELL box: an arrow and a filled box on the main chart, on the closed candle that gave the signal. A BUY sits below the low, a SELL above the high. The box keeps a gap from the candle and stays inside the chart.
  • Entry / SL / TP lines: blue Entry line at the signal candle's close, red Stop Loss, green Take Profit. Older signals' lines end at the bar where the stop or target would have been reached. The latest signal's lines extend to the current bar until a new signal appears.

The signal rule

BUY: on a closed candle, the MACD line crosses above the signal line. SELL: the MACD line crosses below the signal line. Entry is the close of the signal candle. Stop Loss is ATR(14) x 1.5 away from the entry, or beyond the recent swing (your choice). Take Profit is the stop distance times the chosen R multiple. Default is 2R (the original default, faithful to the TradingView study). A tested 3R option is also available; the input label reads "3R - tested upgrade (H1 / D1 only; use 2R on H4)". A custom multiple can be typed when Take Profit is set to Custom.

Signals are written only when a candle has closed, so a mark never moves or disappears afterwards. The histogram and lines of the forming candle update while it is open; they settle when it closes.

When Use Current Chart Timeframe is off, MACD is calculated on Different Timeframe. Each chart bar is given the values of the last bar of that timeframe that had already closed when the chart bar closed. A signal still appears only on a closed chart candle, with no look-ahead.

How to backtest

An indicator cannot run in the Strategy Tester, so check it visually on history:

  1. Open a chart of the symbol and timeframe you want to study and attach the indicator. Raise Bars to Analyze if you want to look further back (default 1000 bars).
  2. Scroll back through the chart. Every past BUY / SELL box stays where it was given.
  3. Turn on Show Entry / SL / TP Lines and set Signals With Lines high enough to cover the period. Older signals' lines stop at the bar where the target or the stop was reached, so you can read how each signal played out. The latest signal's lines stay drawn to the current bar until a new signal appears. The panel status shows Open, Target reached or Stop reached for the last signal.
  4. Try the Take Profit setting (2R, 3R or a custom multiple), the stop mode (ATR from entry or beyond the swing) and, if you use it, another timeframe, and compare on demo before using any setting. The 3R label says to use that option on H1 / D1 and to keep 2R on H4.
  5. For an automatic test with orders, use SGT MACD Pro EA in the Strategy Tester (its manual explains the steps and includes a timeframe table).

Past behavior on a chart does not predict future results.

Inputs (defaults)

MACD Settings

Label Default Meaning
Fast Length 12 Period of the fast EMA used in the MACD (default 12).
Slow Length 26 Period of the slow EMA used in the MACD (default 26).
Signal Length (SMA) 9 Period of the signal line. The signal is an SMA of the MACD, not an EMA (default 9).
Use Current Chart Timeframe true On (default): MACD is calculated on the chart timeframe. Off: use the timeframe below.
Different Timeframe (when above is off) H1 Timeframe used for the MACD when Use Current Chart Timeframe is off.

Signals

Label Default Meaning
Show Buy/Sell Signals (MACD / Signal cross) true Draw the BUY / SELL arrow with its filled label box on the main chart at each closed-candle MACD / signal cross.
Show Entry / SL / TP Lines true Draw Entry, Stop Loss and Take Profit lines for the latest signals.
Signals With Lines 3 How many of the newest signals keep their Entry / SL / TP lines.
Stop Loss Based On ATR from entry ATR from entry: stop = entry minus / plus ATR x multiplier. Beyond recent swing: stop = the lowest low (BUY) or highest high (SELL) of the lookback, minus / plus ATR x multiplier.
Stop Loss (ATR multiplier) 1.5 ATR (14) multiplier for the stop distance (default 1.5).
Swing Lookback (bars) 10 Bars (including the signal candle) searched for the swing extreme when the stop is based on the swing.
Take Profit (R multiple) 2R - original default 2R: take profit = stop distance x 2 (the original default). 3R - tested upgrade (H1 / D1 only; use 2R on H4): take profit = stop distance x 3. Custom R multiple: use the value below.
Custom R multiple (Custom only) 2.0 Used only when Take Profit is set to Custom.

MACD Display

Label Default Meaning
Show MACD & Signal Line true Draw the MACD line and the signal line in the sub-window.
Show Dots When MACD Crosses Signal true Draw a dot on the MACD line at each cross of the signal line.
Show Histogram true Draw the histogram in the sub-window.
Change MACD Line Color on Signal Cross true On: the MACD line is one color when it is above the signal and another when it is below. Off: a single MACD line color is used.
Histogram 4 Colors true On: the four rising / falling colors below. Off: the single histogram color.
MACD Line Above Signal green MACD line color when it is above the signal line.
MACD Line Below Signal red MACD line color when it is below the signal line.
Signal Line gold Color of the SMA signal line.
Histogram Above Zero Rising green Histogram color when the histogram is above zero and rising.
Histogram Above Zero Falling dark tint Histogram color when the histogram is above zero and falling.
Histogram Below Zero Falling red Histogram color when the histogram is below zero and falling.
Histogram Below Zero Rising dark tint Histogram color when the histogram is below zero and rising.
Histogram Unchanged gold Histogram color when the histogram value is unchanged from the previous bar.
Histogram Single Color gray Histogram color when Histogram 4 Colors is off.
MACD Line Width 2 Thickness of the MACD line (1 to 5).
Signal Line Width 1 Thickness of the signal line (1 to 5).
Histogram Width 3 Thickness of the histogram bars (1 to 5).

Alerts

Label Default Meaning
Alert on New Signal true Pop-up alert when a new signal appears on a freshly closed candle.

Chart Display

Label Default Meaning
Bars to Analyze 1000 How many recent bars are analysed and drawn (minimum 150).

Panel

Label Default Meaning
Show Panel true Draw the on-chart information panel.
Panel Corner Bottom Left Chart corner for the panel. Default Bottom Left.
Panel Offset X 15 Horizontal margin from the chosen corner, in pixels at 120 DPI (scaled to your screen).
Panel Offset Y 30 Vertical margin from the chosen corner, in pixels at 120 DPI (scaled to your screen).

The panel

The boxed panel (default Bottom Left, 15 / 30 pixels from the corner, scaled to your screen DPI) shows:

  • MACD: ABOVE SIGNAL or BELOW SIGNAL for the last closed candle. If another timeframe is in use, the badge is labelled with that timeframe (for example MACD H4).
  • Histogram: ABOVE 0 rising, ABOVE 0 falling, BELOW 0 falling, BELOW 0 rising, or UNCHANGED, in the histogram color.
  • Last signal: BUY or SELL on one line, with date, time and price on the line below.
  • Entry, Stop Loss, Take Profit of that signal and its Status (Open, Target reached, Stop reached).
  • License: Free.
  • Footer: Investor Tipster · investortipster.com · SGT · smartgoldtrade.com

Click the header to collapse or expand the panel. All panel and chart objects are removed when you detach the indicator, change the timeframe or symbol, or close the chart.

FAQ

Does a signal repaint? No. Signals use closed candles only. The forming candle never gets a signal.

Is the signal line an EMA? No. In this study the signal line is an SMA of the MACD (default 9), matching ChrisMoody's multi-timeframe MACD on TradingView.

What does the other timeframe option do? When Use Current Chart Timeframe is off, MACD is calculated on the chosen timeframe. Each chart bar uses only the last bar of that timeframe that had already closed when the chart bar closed, so the values do not look ahead or repaint.

Which timeframes and symbols? Any. Lower timeframes give more crosses and more noise; compare on a demo chart. For the 3R take-profit option, the input label says to use it on H1 / D1 and to keep 2R on H4.

Can I change the colors? Yes. All line, histogram and signal colors are inputs.

Risk disclaimer

Trading forex, gold and other leveraged markets involves a risk of loss. This is a technical analysis tool; it does not promise profits or any particular result. Use a demo account first and never risk money you cannot afford to lose.

Inputs (defaults)

  • Fast Length = 12
  • Slow Length = 26
  • Signal Length (SMA) = 9
  • Use Current Chart Timeframe = true
  • Different Timeframe (when above is off) = H1
  • Show Buy/Sell Signals (MACD / Signal cross) = true
  • Show Entry / SL / TP Lines = true
  • Signals With Lines = 3
  • Stop Loss Based On = ATR from entry
  • Stop Loss (ATR multiplier) = 1.5
  • Swing Lookback (bars) = 10
  • Take Profit (R multiple) = 2R - original default
  • Custom R multiple (Custom only) = 2.0
  • Show MACD & Signal Line = true
  • Show Dots When MACD Crosses Signal = true
  • Show Histogram = true
  • Change MACD Line Color on Signal Cross = true
  • Histogram 4 Colors = true
  • MACD Line Above Signal = green
  • MACD Line Below Signal = red
  • Signal Line = gold
  • Histogram Above Zero Rising = green
  • Histogram Above Zero Falling = dark tint
  • Histogram Below Zero Falling = red
  • Histogram Below Zero Rising = dark tint
  • Histogram Unchanged = gold
  • Histogram Single Color = gray
  • MACD Line Width = 2
  • Signal Line Width = 1
  • Histogram Width = 3
  • Alert on New Signal = true
  • Bars to Analyze = 1000
  • Show Panel = true
  • Panel Corner = Bottom Left
  • Panel Offset X = 15
  • Panel Offset Y = 30
Trading involves risk. Indicators show past price behaviour and do not guarantee results. Test on a demo account first.