Do you use it as iCustom, or do you duplicate your indicator code in the EA?
I implement the code in the EA, since it doesn't need displaying, it saves memory.
For example, one indicator I wrote has many buffers, several moving averages, shows many lines, and is slow to render.
During back-testing, I found this indicator to be prohibitively slow.
Therefore, I put the calculations into the EA.
Then, if I am back-testing or optimizing, I use the internal calculations; otherwise, I use iCustom() to show me all the lines, averages, etc.
if ( MQLInfoInteger(MQL_TESTER) || MQLInfoInteger(MQL_OPTIMIZATION) )
// Use internal EA calculations for my indicator
// Visual is important, so use
// iCustom() for my indicator
and the difference between using icustom or calculation inside ea is huge ?
Yes, it is.
Sure it does. In the backtester in visual mode. They're thin red lines on the chart window and a bunch of separate windows. The backtester renders all indicators used by the EA. Clutters up the screen.
You can have the benefit of using visual mode, show some indicators, yet, not show a specific indicator when the values are calculated internally in the EA.
If you use iCustom in your EA, it might be computation intensive on your EA especially if you are looping for each chart bar.
If you duplicate your indicator code in your EA, the code will be too tightly coupled. If you want to improve your indicator, you will have to change the code of your EA. Complicated.
My advice will be create global variables with your indicator, and let your expert adviser uses them.