Re: The Mean Goose Reversal indicator MT5

14
Elias1373 wrote: Sun Jun 28, 2026 11:35 pm please check guys
We can't check the code because it's an EX4. Seeing as the author has provided the source code and left it open, it would be good for you to also provide the MQ4 file as well.

Please edit your post and allow others access to the MQ4 in good faith so we can learn and see what's in it!
List of our most powerful reversal indicators | Guide to the "All Averages" Filters (ADXvma, Laguerre etc.)
Using Fibonacci "numbers" for indicator settings 💡
How to draw Fibonacci Extensions easily | The best way to draw Support & Resistance

Re: The Mean Goose Reversal indicator MT5

15
Jimmy wrote: Sun Jun 28, 2026 11:40 pm We can't check the code because it's an EX4. Seeing as the author has provided the source code and left it open, it would be good for you to also provide the MQ4 file as well.

Please edit your post and allow others access to the MQ4 in good faith so we can learn and see what's in it!
Sorry :)
These users thanked the author Elias1373 for the post (total 4):
elvenso, Nik123, Jimmy, moey_dw

Re: The Mean Goose Reversal indicator MT5

16
Here is latest version 1.02

I release this version at the same time as the MT4 version that you can get here: The Mean Goose reversal indicator MT4.

This version is optimized for efficiency and there was still some trouble with disappearing arrows when on live data (but alerts were not affected), So I fixed both

cheers !

Jef
These users thanked the author ionone for the post (total 15):
LittleCaro, mahdinik200, Jimmy, Eis, RodrigoRT7, Lucas, mrWowka, Elias1373, thomdel, SijjiN, AlainP, pererva, moey_dw, saugio15, ashdays
Scalping the Century TimeFrame since 1999

DownloadRe: The Mean Goose Reversal indicator MT5

19
I took the freedom to rewrite and optimize this indicator my own way.

Here is a detailed breakdown of the critical fixes and new features implemented:

1. Eliminated the Index Shifting Bug (`i` vs `i-1`)
The loop math has been entirely rewritten. The relationship between linear historical loop indexing and the MT5 `CopyBuffer` shift (where shift `0` is the current forming bar) is now perfectly aligned and mathematically correct.

2. Persistent State Buffers (Fixing the Live vs. History Repainting)
All vital states, including session rolling highs/lows (`dayHighBuf`/`dayLowBuf`) and triggers, have been moved into dedicated MT5 calculation buffers (`INDICATOR_CALCULATIONS`). Because these are stored per-bar, history and live charts are 100% consistent, and the indicator is fully backtest-safe.

3. Compile Fixes & Memory Initialization
Codes are strictly cleaned up. Persistent buffers are explicitly initialized on the first run (`prev_calculated == 0`) to prevent MT5 from reading dirty memory (garbage values).

4. Guarded External Indicator Calls (`CopyBuffer` Protection)
Implemented a bulletproof helper function (`GetIndiSafe`). If data copying fails or the indicator is warming up, it gracefully skips the bar and retains the previous valid mathematical state, preventing spikes or zero-value bands.

5. True Breakout Edge Arming
The trigger now arms strictly on the true breakout edge (the exact bar where the price first exits the channel). It won't continuously re-arm while the price simply drifts in a trend.

New Trading Features & EA Compatibility

1) Trigger Timeout (Bars): You can now define a timeout (e.g., 50 bars) after which an armed trigger will expire, preventing stale signals.
2) Anti-Whipsaw Filter: An optional toggle requiring the price to still reside outside the wide Keltner Channel (`KC1`) at the exact moment the fast EMA triggers the signal.
3) Mean-Reversion Target (TargetLine): Added a dashed line representing the Keltner basis (`kc1_ma`). This serves as the natural statistical target for the Mean Reversion setup.
4) EA-Ready Event Buffers: `activeDirBuf`: Tracks open virtual trades (1 for long, -1 for short, 0 for idle).
5)`targetHitBuf`: Fires a 1.0 event buffer signal when the price reaches the target.
6)`tradeOverriddenBuf`: Fires a 1.0 event if an active trade is forced closed/invalidated by a new opposite signal before hitting its target.
7) You can now easily read all these states in your automated EA using a simple `iCustom` / `CopyBuffer` setup!
These users thanked the author AlgoAlex811 for the post (total 11):
mazibee, boytoy, Cagliostro, Jimmy, Eis, ricosuaveiii, mrWowka, Krunal Gajjar, saugio15, vashet, forexjoe85
My professional trading tools:
Mql5 "alexf81"