MACD OsMA Color MTF Alerts Indicator: H4 Context

Written by Dominic Walsh · Published · Last updated

The macd osma color mtf alerts indicator plots OsMA, which is the distance between the MACD main line and its signal. Positive bars print lime, negative bars print red, and a gold line carries the same reading from the timeframe set in `MTF_TF`. `Scale` multiplies everything so forex values stay visible.

This build ships as a compiled .ex4 for MT4 and .ex5 for MT5; the screenshots below come from EURUSD H1.

Platforms MT4 (.ex4) + MT5 (.ex5)
Chart window Separate window (levels 0)
Plots 5: OsMA Up, OsMA Down, OsMA MTF, Buy, Sell
Alerts popup, push notification, email, sound
Inputs 11

What the Macd Osma Color Mtf Alerts Indicator draws on the chart

OsMA Up is the lime histogram covering positive readings.

OsMA Down is the red histogram covering negative ones.

OsMA MTF is the gold line carrying the higher-timeframe reading, H4 by default.

Buy and Sell place aqua and magenta arrows in the pane, with a level line drawn at zero.

  • OsMA Up: histogram, lime, width 3
  • OsMA Down: histogram, red, width 3
  • OsMA MTF: line, gold, width 2
  • Buy: arrow, aqua, width 2, arrow code 233
  • Sell: arrow, magenta, width 2, arrow code 234
MACD OsMA color MTF alerts indicator on EURUSD H1 with the H4 gold line over the histogram
MACD OsMA color MTF alerts indicator on EURUSD H1 with the H4 gold line over the histogram

How the Macd Osma Color Mtf Alerts Indicator calculates its values

Building OsMA from MACD

OsMA_TF calls iMACD with `FastEMA` `12`, `SlowEMA` `26` and `SignalSMA` `9`, then takes the main line minus the signal line. That difference is the histogram. It crosses zero at exactly the moment the MACD main line crosses its own signal.

Bringing in the higher timeframe

iBarShift maps the current bar time onto `MTF_TF`, which defaults to PERIOD_H4. OsMA_TF then runs again on that timeframe and the answer feeds the gold line. So the pane carries the local reading as bars and the H4 reading as a line over the top.

Making the values visible

`Scale` defaults to `10000.0`. Raw OsMA on EURUSD sits in the fourth decimal place, which would flatten the pane into a smear. Multiplying by ten thousand puts the histogram into readable units. Change it when you run the tool on gold or an index, where the raw numbers are already large.

How to read the signals

Bars above zero mean the MACD main line leads its signal.

Colour flips at zero, so the crossing is the moment the histogram changes shade.

When the gold line and the local bars share a sign, both timeframes agree.

A shrinking histogram means the two MACD lines are converging.

Alert channels in this build: popup, push notification, email and sound, one message per closed bar.

`EnableAlerts` ships off, so nothing fires until you switch it on. After that `EnablePopup`, `EnableSound` and `EnablePushNotify` are already true and `EnableEmail` is false, with `SoundFile` naming the clip. The guard allows one message per closed bar.

Every Macd Osma Color Mtf Alerts Indicator input

Core settings

Setting What it does Default
FastEMA MACD fast EMA period. MACD fast EMA, default `12`. 12
SlowEMA MACD slow EMA period. MACD slow EMA, default `26`. 26
SignalSMA MACD signal SMA period. MACD signal SMA, default `9`. 9
MTF_TF Higher TF for OsMA context. Timeframe behind the gold line, default PERIOD_H4. Pick something at least four times the chart period or the line adds nothing. PERIOD_H4
Scale Visibility scale for FX. Display multiplier, default `10000.0`. Lower it on instruments quoted in whole numbers. 10000.0

Alert settings

Setting What it does Default
EnableAlerts Master alerts toggle. Master alert switch, default `false`. Nothing fires until you turn this on. off
EnablePopup Popup alert. Terminal popup, default `true`. on
EnableSound Sound alert. Sound playback, default `true`. on
EnablePushNotify Push to mobile MetaTrader. Mobile push, default `true`. on
EnableEmail Email alert. Mail delivery, default `false`. off
SoundFile Clip played when sound is on, default `alert.wav`. alert.wav
MACD OsMA color MTF alerts indicator inputs: FastEMA, SlowEMA, SignalSMA, MTF_TF, Scale
MACD OsMA color MTF alerts indicator inputs: FastEMA, SlowEMA, SignalSMA, MTF_TF, Scale

Settings that fit your chart

OsMA suits any instrument that trends and then pulls back. EURUSD H1 with `MTF_TF` at PERIOD_H4 is the reference pairing, and that four-to-one ratio works well. On M5 with an H1 context the bars move fast while the gold line stays readable. Keep the two timeframes far enough apart, or the line just traces the histogram.

When the Macd Osma Color Mtf Alerts Indicator fails

OsMA is a difference between two lagging averages, so it turns after price does.

The gold line repeats one value across four H1 bars, which can look like agreement that has not actually moved.

`Scale` is cosmetic. A pane that looks dramatic at `10000.0` may be showing a tiny move.

Copy the compiled Macd Osma Color Mtf Alerts Indicator file into your MQL4/Indicators folder, and the MT5 build into MQL5/Indicators, then restart the terminal and drag it onto a chart. The step-by-step guide with screenshots is at how to install MT4 and MT5 indicators.

Download the Macd Osma Color Mtf Alerts Indicator for MT4 and MT5

The zip holds the compiled Macd Osma Color Mtf Alerts Indicator build for MT4 and MT5, plus a short README. Compiled files only, no source. Enter your email below and the download link arrives in your inbox.

Download this indicator free

Enter your email and the file is yours. You also get the full MT4 and MT5 library.

  • 1,380+ indicators
  • MT4 and MT5 files
  • No spam, unsubscribe any time

FAQ

What does MTF_TF at PERIOD_H4 add?

A second reading of the same calculation from a higher timeframe, drawn as the gold OsMA MTF line. iBarShift maps each chart bar to its H4 parent, so the line steps rather than curves. It gives you higher-timeframe context without opening a second chart.

Why does Scale default to 10000.0?

Because raw OsMA on a five-digit forex pair lives in the fourth decimal place. Left alone the histogram would sit flat against zero. Multiplying by ten thousand puts it into pip-sized units. Lower the setting on gold or an index, where prices already run into the hundreds.

Do I need to switch EnableAlerts on?

Yes. It ships as false, which is unusual for this library and deliberate here. `EnablePopup`, `EnableSound` and `EnablePushNotify` are already true underneath it, so flipping the master switch turns on three channels at once. Set the ones you do not want to false first.

What separates OsMA Up from OsMA Down?

Only the sign. Both plots receive the same value, and the lime bars cover positive readings while the red bars cover negative ones. Colour therefore changes at the zero level line, which is the same moment the MACD main line crosses its signal.

Are results guaranteed?

No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Macd Osma Color Mtf Alerts Indicator as one input. Always backtest before trading live.

Category: this is part of our Oscillators collection. Browse more Oscillators for MetaTrader, or explore every MT4 indicator and MT5 indicator on the site.

External references

Dominic Walsh - Forex trader and MT4/MT5 developer

About the author

Written by Dominic Walsh, a Forex trader and MT4/MT5 indicator, Expert Advisor and script developer. Every tool on forexmt4systems.com is tested on live charts before release and ships with ready-to-use compiled MT4 (.ex4) and MT5 (.ex5) files. Learn more about the trader and developer behind this site.

How we build, test and correct every tool: Editorial & Testing Policy. Trading carries risk; see the disclaimer.

Leave a Comment