I updated the QFF-MACD v1.mq4 indicator to QFF-MACD Histo.mq4 that includes an option to show the default MACD histogram OR the Signal/MA cross trend histogram.srinarayani13 wrote: Fri Oct 24, 2025 7:07 pm I went short here and was stopped out, traded in direction of higher trend
but got stopped out in correction MACD signal EMA was positive after MACD signal EMA turned negative price started following larger trend
MACD EMA signal can help us to reduce loss making trade and can help for perfect entry
Global can you please add histogram for signal EMA cross at bottom so that it will be easy to see the direction.
Key Changes & Fixes
Increased to 13 buffers and added zeroAnchor[] buffer.
Features Included:
• Dual-mode display: Full MACD histogram OR Signal/MA cross trend histogram
• 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
When ShowSignalMaHisto = true:
• Displays the trend of the MACD Signal/Signal Ma Cross.
• The trend strength, based on the Signal line's slope, is also shown.
• Buffers 8–11 draw colored histograms at height 1.0.
• Buffer 12 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.
When ShowSignalMaHisto = false:
• Standard MACD histograms (buffers 0–3) with signal/MA lines.
• Auto-scales to MACD data range (includes negatives and positives).
• 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 ShowSignalMaHisto and pressing OK reinitializes the indicator.
• Scaling automatically adjusts correctly in both 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.