OsMA measures the gap between MACD and its signal line. A positive reading places MACD above that signal, even when MACD itself is negative. This guide reconstructs both series on real GBP/USD H1 quotes and separates sign, change and fresh crosses.
1. Identify which difference the histogram shows
The MACD main value subtracts a slower price EMA from a faster one. OsMA subtracts a second reference: the signal average of those MACD values. A histogram described as MACD-minus-signal therefore represents OsMA when its inputs match. A histogram of the MACD main value represents a different series; check the formula and buffer rather than relying on the chart name.
OsMA is positive when MACD exceeds Signal and negative when it is below Signal. Equality gives zero. Its magnitude is a price difference, not a percentage, a probability or measured buying volume. Here one GBP/USD pip is 0.0001 USD per GBP; the indicator panels display pips, while the price EMAs retain quote units.
2. Declare the EMA seeds and the signal average
For this reconstruction, each price EMA starts with the mean of its first N recorded closes, then updates with α=2/(N+1). EMA12 first exists on candle 12 and EMA26 on candle 26. MACD becomes available when both exist. Signal9 first averages nine available MACD values, making OsMA(12,26,9) available on recorded candle 34; earlier values remain unavailable.
The SMA signal uses the current and preceding N−1 available MACD values. The EMA variant begins from that same initial mean, then applies its own exponential weighting. Changing the signal method leaves the two price EMAs and MACD unchanged. The seed and retained history are explicit choices; matching a terminal requires matching its history and initialization too.
α_N = 2 / (N + 1) EMA_N(N−1) = mean(Close(0) … Close(N−1)) EMA_N(t) = α_N × Close(t) + (1−α_N) × EMA_N(t−1) MACD(t) = EMA12(Close)(t) − EMA26(Close)(t) Signal_SMA(t) = mean(MACD(t−N+1) … MACD(t)) OsMA(t) = MACD(t) − Signal(t) 1 pip = 0.0001 USD per GBP
3. Recognize a signal cross while MACD stays below zero
At the hour ending 2024-01-05 15:00 UTC, EMA12 is 1.267006672 and EMA26 is 1.267245714. MACD is −2.390416 pips and its SMA9 signal is −2.554712 pips. Their difference is OsMA +0.164296 pip. The preceding OsMA was −3.458939 pips, so this is a fresh upward OsMA cross while MACD remains negative.
Our upward test requires previous OsMA≤0 and current OsMA>0. The downward test requires previous OsMA≥0 and current OsMA<0. Merely touching zero does not pass either test. Because OsMA is defined by MACD minus Signal, its zero cross and the corresponding MACD/signal cross express the same event.

4. Separate a falling positive bar from a negative cross
At 2024-01-05 20:00 UTC, OsMA falls from +10.506937 to +9.449886 pips and remains positive. MACD actually rises from +11.939536 to +12.688849 pips: the signal rises faster, narrowing their gap. A falling OsMA reading therefore does not, by itself, establish that MACD is falling or has crossed below its signal.
In these charts, blue OsMA columns are positive and gold columns are negative. Those colors encode sign; candle colors separately encode Close versus Open. Compare the current and previous values to determine change, and use the stated inequalities to identify a fresh zero cross. These observations do not specify a trade entry.

5. Change SMA to EMA without changing the quotes
On the same 15:00 candle, the EMA9 signal is −2.346651 pips. Subtracting it from the unchanged MACD gives OsMA −0.043764 pip, whereas the SMA9 version gives +0.164296. The SMA version crosses upward on this candle; the EMA version does not. The difference comes from signal weighting, not a different closing price.
The explorer also offers signal periods 5 and 18 beside 9. A longer SMA uses a wider finite window; an EMA retains older values with declining weights. These fixed settings illustrate sensitivity, not a search for the most profitable combination. Label the method, periods, applied price and initialization before comparing two charts.

6. Use ended intervals and check the MT4 inputs
The highlighted timestamp is the end of the reconstructed H1 interval. During an active candle, Close, both price EMAs, MACD and the current signal can all change. An intrabar crossing can disappear before that interval ends. The historical examples use only information available through the selected interval, with missing-minute coverage shown separately.
MQL4 iOsMA accepts a symbol, timeframe, fast EMA period, slow EMA period, signal period, applied price and buffer shift. This guide uses Close. When the expected new bar exists, shift 1 refers to the preceding bar and shift 0 to the current one. Native-terminal parity has not been checked; the downloadable reconstruction states its own seeds and history.
7. Inspect the same candle under both signal methods
Choose the signal period and method, then move through the recorded candles. The first two example buttons restore SMA9; the smoothing example selects EMA9. Changing either selector keeps the candle fixed. The table compares both methods at that same period and timestamp. Initial candles show unavailable readings instead of invented zeros.
The sample contains 31,736 minute records and 529 observed H1 candles: 525 full hours, four partial hours and four gaps between recorded hours. Gaps are not filled; EMA history carries across them. Examples are selected chronologically after 80 recorded candles with a full 36-hour display window. The plotted window does not truncate the indicator history.
Loading recorded candles…
- Interval end · UTC
- —
- OHLC · USD per GBP
- —
- EMA12 · USD per GBP
- —
- EMA26 · USD per GBP
- —
- MACD · pip
- —
- Signal · pip
- —
- OsMA · pip
- —
- Previous OsMA · pip
- —
- OsMA change · pip
- —
- Recorded minute bars in this hour
- —
- Gap before this hour
- —
- Recorded candles from history start
- —
- Gaps in that full history
- —
- Partial hours in that full history
- —
—
—
Same candle · SMA versus EMA signal
| Signal average | Signal · pip | OsMA · pip | Fresh OsMA zero crosses |
|---|---|---|---|
| SMA | — | — | — |
| EMA | — | — | — |
Price EMA seed: mean of the first N recorded closes. Signal EMA seed: mean of the first N available MACD values.
Historical illustration · no trades
Frequently asked questions
Is OsMA the same as the MACD histogram?
It is the MACD-minus-signal histogram when both use identical inputs and averaging rules. A histogram showing the MACD main value is different. Check the formula, periods, applied price and signal method before treating two plotted histograms as equivalent.
Can OsMA be positive while MACD is negative?
Yes. MACD can be below zero yet above an even more negative signal. On the illustrated 15:00 candle, MACD is −2.390416 pips and its SMA9 signal is −2.554712 pips, producing positive OsMA.
Does a shrinking positive column mean a sell signal?
A smaller positive column shows that the MACD-to-signal gap narrowed. It remains above zero and has not passed our downward-cross test. A strategy would need separate entry, exit, cost and risk rules.
Will SMA9 and EMA9 give the same OsMA?
They share the declared initial signal mean but usually diverge afterward because their weights differ. In our 15:00 example, SMA9 produces positive OsMA while EMA9 produces negative OsMA on identical quotes.
Why does this reconstruction need 34 candles for 12/26/9?
The slow price EMA begins on recorded candle 26. Nine available MACD values then end on candle 34. Earlier OsMA values are unavailable under the stated seeding rules. A platform with other history or initialization can display different early readings.
Which OsMA setting is most profitable?
This guide does not test trades or profitability. It compares fixed signal methods and periods to explain calculation and timing. A profitability claim would require a separate, declared strategy test with execution costs and risk limits.
Data, calculation choices and scope
The source is Forexite’s January 2024 Trade/MetaStock minute OHLC archive. Its fixed GMT+1 labels are shifted back one hour to UTC. Interpreting each label as an interval end and grouping H1 observations in (start,end] are declared reconstruction assumptions. The history runs from 2024-01-01 22:00 UTC through the interval ending 2024-01-31 23:00 UTC. This is a historical illustration.
The download retains 31 original daily ZIPs with SHA256, extracted GBP/USD minutes, calculated readings and both calculation scripts. A separately written parser, hourly aggregation and weighted-EMA calculation checked the outputs and events. Both implementations and the translations were written by the same assistant; independent-human, native-speaker and native-terminal certification is not claimed. No fills, returns or trading edge are tested.
