Hey guys,
I've extended the basic Zigzag indicator as following:
- peaks on close values (not wicks)
- 4 additional arrays: valid highs & valid lows + associated wicks. They save the peaks as soon as they're not changeable anymore
- after new valid high it compares with previous high wick + 20 pips to detect bullish market structure break. new valid lows vice versa for bearish msb.
- after msb it calculates some fibonacci retracement levels (additional Fib Array)
The indicator prints those msb + fib levels into the journal. Now I want to get those fib levels into an EA where I can implement further confirmations to open trades but I don't get it... tried to implement the whole calculation into the EA, tried through iCustom and with global variables but nothing works like I want it.
Simply said I only need the EA to get the Fib Array and when price comes into thos fib levels i can imlement further code.
The indicator code is attached. Hope you guys understand my concern and maybe someione can help...
Best regards
Dennis
Your indicator code is storing Fib values via GlobalVariableSet().
Just use GlobalVariableGet() to get them: Global Variables of the Terminal - MQL4 Reference

- docs.mql4.com
Your indicator code is storing Fib values via GlobalVariableSet().
Just use GlobalVariableGet() to get them: Global Variables of the Terminal - MQL4 Reference
Thanks for fast reply 🙏🏽
I am sure that Global variables are not meant to work in strategy tester. do a search of the site.
ChatGPT says it works but I’ll search on the site 😬
that is a word that "shant" be used in this forum. Moderators have been known to delete threads, messages, and comments that even mention that word just once (hahahahahahahaha) especially code that is clearly, NOT, coded by a live person.
EDIT: your code may work in live terminal, however, to use it on strategy tester, you will need to use other means to save your levels.that is a word that "shant" be used in this forum. Moderators have been known to delete threads, messages, and comments that even mention that word just once (hahahahahahahaha) especially code that is clearly, NOT, coded by a live person.
EDIT: your code may work in live terminal, however, to use it on strategy tester, you will need to use other means to save your levels.I am sure that Global variables are not meant to work in strategy tester. do a search of the site.
"Basically, all works with global variables are performed programmatically. However, this window might be useful when testing EAs."
MQL5 Programming Basics: Global Variables of the MetaTrader 5 Terminal
Dmitry Fedoseev, 2016.11.25 13:11
Global variables of the terminal provide an indispensable tool for developing sophisticated and reliable Expert Advisors. If you master the global variables, you will no more be able to imagine developing EAs on MQL5 without them.Thanks for fast reply 🙏🏽
Yes.
Also, have a look at GlobalVariableCheck() for the purpose of first confirming that the preceding GV has been deleted.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hey guys,
I've extended the basic Zigzag indicator as following:
- peaks on close values (not wicks)
- 4 additional arrays: valid highs & valid lows + associated wicks. They save the peaks as soon as they're not changeable anymore
- after new valid high it compares with previous high wick + 20 pips to detect bullish market structure break. new valid lows vice versa for bearish msb.
- after msb it calculates some fibonacci retracement levels (additional Fib Array)
The indicator prints those msb + fib levels into the journal. Now I want to get those fib levels into an EA where I can implement further confirmations to open trades but I don't get it... tried to implement the whole calculation into the EA, tried through iCustom and with global variables but nothing works like I want it.
Simply said I only need the EA to get the Fib Array and when price comes into thos fib levels i can imlement further code.
The indicator code is attached. Hope you guys understand my concern and maybe someione can help...
Best regards
Dennis