Why OsMA can be negative while MT5 MACD is positive

Why OsMA can be negative while MT5 MACD is positive

Identify the two values

Attach MACD and Moving Average of Oscillator to one chart. Match fast, slow and signal periods and applied price. Read the main and signal values for a completed candle in the Data Window. The height of the bars in MT5's MACD panel represents the main series; the residual has its own panel in this comparison.

Take the difference

With a main value of 0.80 and a signal of 1.10, the residual is negative 0.30. Both inputs are above zero. The main line sits below its signal, which is enough to make OsMA negative. Changing chart scale may make two panels look aligned without making their values interchangeable.

OsMA = MACD − Signal

Locate a real crossing

On the next bar assume main equals 0.95 and signal equals 0.90. The residual is positive 0.05. OsMA crossed zero between these observations even though the MACD main series stayed above zero throughout. In an event log, distinguish a main-line zero crossing from a main-versus-signal crossing.

Compare precision before sign

Take at least one point near zero and one far from zero. Subtract the unrounded values where available. Two displayed values that both round to 0.01 need not be equal internally. When coding a crossover, decide explicitly what should happen if the residual is exactly zero for a bar.

Sources and further reading

Back to top

MQLume Bespoke

Built around your ambition.

Explore bespoke services →

Have something more specific in mind?

Ask us about advanced custom development. Share your requirements through private support or email; we will discuss the scope and quote separately.

100% committed to following up on your delivery and support requests.

Free downloads. Real source files.

FREE

Lizard [MQLume]

MQL5 / MT5Version v2.21

Free editable gold breakout project with six independently selectable cores, session filters and flexible position sizing.

US$149.00FREE
FREE

Scraper Gold [MQLume]

MQL5 / MT5Version v3.80

Free editable source with compiled EX5: four gold breakout engines with independent profiles, sizing, direction and exits.

US$95.00FREE
FREE

EA Black Dragon [MQLume]

MQL5 / MT5Version v13.0

Trend-based entries with optional grid additions, side controls and virtual exits.

US$30.00FREE
FREE

Hamster Scalping [MQLume]

MQL5 / MT5Version v21.0

RSI entries with two ATR filters, configurable sessions and optional grid management.

US$30.00FREE
MQLume

More to explore. A community to share it with.

Stay close to MQLume, wherever you like to learn.

YouTube

See our EAs in action. Explore backtests, walkthroughs and practical guides.

Watch on YouTube

Telegram

Meet other EA users, share ideas and keep up with what’s new.

Join the community Follow official updates

Cart

One personal-use licence per project. Each project can be added once.

Your cart is waiting for its first passenger.

Choose an EA or source edition to get started.

Continue shopping