I am trying to transition from MQL4 to MQL5, yet some things are still confusing me.
After having created a custom indicator I created a simple EA to just call it. Using both iCustom() and IndicatorCreate() there is no indicator output (I am using only buffers no objects in my indicator) on my terminal. Having read older posts in forum I realized that this is standard behavior in MQL5 (at least for iCustom()).
1)Would there be a way to output the indicator output when being called from an EA?
2)What is the standard practice to see what an EA is doing when calling indicators? You manually add the indicators on the chart as well?
Both iCustom() and IndicatorCreate() should be called within the init function, and will initiate computation of the indicator. These functions only return a handle, not computation results.
1) When you need to get the computed values, you'll have to use CopyBuffer(). And to ensure the computation has been completed, it is useful to call BarsCalculated() first to check.
2) Yes, you add the indicator to the chart as well.
https://www.mql5.com/en/docs/series/copybuffer
- www.mql5.com
Thanks Seng,
Not really what i am looking for. I know how to retrieve the values form the indicator and use them in my EA logic. What i can't find is how to make my EA plot the indicator that i am calling.
Thanks Seng,
Not really what i am looking for. I know how to retrieve the values form the indicator and use them in my EA logic. What i can't find is how to make my EA plot the indicator that i am calling.
2)What is the standard practice to see what an EA is doing when calling indicators? You manually add the indicators on the chart as well?
Sometimes I do that when it's the expedient solution.
For example, if I am running an EA through the tester, and my EA isn't showing my custom indicator because I have:
TesterHideIndicators(true);
and I don't want to recompile, I will just add that indicator to Tester.tpl.
I also use @Alain Verleyen 's suggestion of ChartIndicatorAdd() if I want to show/hide an indicator by pushbutton.
Forum on trading, automated trading systems and testing trading strategies
EA calling an indicator with iCustom() or IndicatorCreate()
Alain Verleyen, 2019.05.30 19:12
ChartIndicatorAdd().So simple! Feel like an idiot. Not sure why i was only looking at functions like iCustom(), IndicatorCreate().
Thanks Alain!
Forum on trading, automated trading systems and testing trading strategies
EA calling an indicator with iCustom() or IndicatorCreate()
Anthony Garot, 2019.05.31 02:19
Sometimes I do that when it's the expedient solution.
For example, if I am running an EA through the tester, and my EA isn't showing my custom indicator because I have:
TesterHideIndicators(true);
and I don't want to recompile, I will just add that indicator to Tester.tpl.
I also use @Alain Verleyen 's suggestion of ChartIndicatorAdd() if I want to show/hide an indicator by pushbutton.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi All,
I am trying to transition from MQL4 to MQL5, yet some things are still confusing me.
After having created a custom indicator I created a simple EA to just call it. Using both iCustom() and IndicatorCreate() there is no indicator output (I am using only buffers no objects in my indicator) on my terminal. Having read older posts in forum I realized that this is standard behavior in MQL5 (at least for iCustom()).
1)Would there be a way to output the indicator output when being called from an EA?
2)What is the standard practice to see what an EA is doing when calling indicators? You manually add the indicators on the chart as well?
Any help much appreciated,
Thanks Leonidas