Re: MT4 Indicators with alerts/signals

4383
I was trying to add arrows using AI to Zero Lag True MACD 1.0 but I got different result, sell arrow plotting on all candles

I was trying to add arrow for

1. MACD crossing Zero
2. Signal line crossing MACD

Seeing result of MACD crossing zero, I did not try for signal line crossing MACD coding using AI

Please help to plot arrows properly.

Re: MT4 Indicators with alerts/signals

4384
srinarayani13 wrote: Wed Dec 24, 2025 2:38 am I was trying to add arrows using AI to Zero Lag True MACD 1.0 but I got different result, sell arrow plotting on all candles

I was trying to add arrow for

1. MACD crossing Zero
2. Signal line crossing MACD

Seeing result of MACD crossing zero, I did not try for signal line crossing MACD coding using AI

Please help to plot arrows properly.
Hello, try this version.
These users thanked the author mrtools for the post (total 4):
BeatlemaniaSA, srinarayani13, kysbog, navid110


Re: MT4 Indicators with alerts/signals

4386
global wrote: Sat Nov 15, 2025 6:12 am I updated the QFF-MACD Histo.mq4 indicator to QFF-MACD OsMAx Histo.mq4 that can now show three display types:

• The Full MACD histogram
• The Osma of Signal/MA
• And the OsMA of Signal/Ma Histogram Only

The screenshot below shows the three different types of displays.

Note that this indicator is different than most OsMA MACD indicators especially because:

The OsMA shown = (Signal - SignalMA)
• But with standard OsMA indicators, the OsMA shown = (MACD - Signal)

Key Changes & Fixes

Increased to 14 buffers and added zeroAnchor[] buffer.

Features Included:

• Triple-mode display: Full MACD histogram, Osma of Signal/MA OR OsMA of Signal/Ma Histogram Only.
• Automatic scaling in both modes using zero-anchor technique.
• Clean, efficient code with proper boundary checks.
• Customizable colors and histogram width.
• No scaling bugs — works perfectly when switching modes.
• All line and histogram colors are configurable.

When Display Type = MACD Signal/Ma:

• Standard MACD histograms (buffers 0–3) with signal/MA lines (buffers 5–6).
• Auto-scales to MACD data range (includes negatives and positives).

When Display Type = OsMA of Signal/Ma:

• Displays the trend of the OsMA of the Signal/Ma.
• The trend strength, based on the OsMA line's slope, is also shown by different colors.
• Buffer 8 draws the OsMA line and Buffers 9–12 draws colored OsMA Auto-scaled histograms.
• OsMA of Signal/Ma histograms (buffers 9–12) with signal/MA lines (buffers 5–6).
• Auto-scales to OsMA data range (includes negatives and positives).
• OsMA of Signal/Ma histograms (buffers 9–12) with signal/MA lines (buffers 5–6).
• The OsMA Multiple X increases the display height of the OsMA line/histograms.

When Display Type = OsMA of Signal/Ma Histogram Only:

• Displays the trend of the OsMA of the Signal/Ma.
• The trend strength, based on the OsMA line's slope, is also shown by different colors.
• Buffers 9–12 draw colored histograms at height 1.0.
• Buffer 13 draws an invisible (zero-height) black histogram at 0.0 on every bar.
• This forces auto-scaling to exactly 0 to 1, with full-height colored bars.

• Removed manual buffer reset logic (unnecessary with MT4's reinitialization on parameter changes).
• Removed _StopFlag checks (undefined; prevents potential compile errors).
• Added boundary check i < Bars - 1 in trend calculation to avoid array out-of-bounds.
• Cleaned up unused code (e.g., Max function).

Behavior on switching:

• Changing the DisplayType and pressing OK reinitializes the indicator.
• Scaling automatically adjusts correctly in all modes—no clipping, no stuck scales.
• No need to remove/reattach the indicator.

This works reliably because MT4's auto-scaling now includes the anchor at 0.0 in signal mode while remaining invisible.


QFF-MACD OsMAx Histo.png
This is an update fix to the QFF-MACD OsMAx Histo indicator which may sometimes cause an array out of range error.

This new QFF-MACD OsMAx Histo v1 version simple replaces this line:

int i, limit = MathMin(Bars - counted_bars, Bars - 1);

with this line that prevents an array out of range error from occurring:

int i, limit = MathMin(Bars - counted_bars, Bars - maxPeriod);

These users thanked the author global for the post (total 3):
mazibee, Jimmy, thomdel