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.