Download MetaTrader 5

If you have developed an indicator from scratch, and want to use it in your EA. Do you use it as iCustom, or do you duplicate your indicator code in the EA?

To add comments, please log in or register
Pierre Rougier
558
Pierre Rougier  
Hello,

If you have developed an indicator from scratch, and want to use it in your EA.

Do you use it as iCustom, or do you duplicate your indicator code in the EA?

Regards.

Icham Aidibe
10818
Icham Aidibe  
Pierre Rougier:
Hello,

If you have developed an indicator from scratch, and want to use it in your EA.

Do you use it as iCustom, or do you duplicate your indicator code in the EA?

Regards.

I implement the code in the EA, since it doesn't need displaying, it saves memory.

Anthony Garot
413
Anthony Garot  
Pierre Rougier:
Hello,

If you have developed an indicator from scratch, and want to use it in your EA.

Do you use it as iCustom, or do you duplicate your indicator code in the EA?

Regards.

Sometimes both.

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
}
else
{
    // Visual is important, so use
    // iCustom() for my indicator
}
Bilal Said
496
Bilal Said  
Anthony Garot:

Sometimes both.

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.


and the difference between using icustom or calculation inside ea is huge ?

Icham Aidibe
10818
Icham Aidibe  
Bilal Said:

and the difference between using icustom or calculation inside ea is huge ?

Yes, it is.

whroeder1
17125
whroeder1  
  1. There are no buffers, no IndicatorCounted() or prev_calculated. No way to know if older bars have changed or been added (history update.)
    Just get the value(s) of the indicator(s) into the EA and do what you want with it.
    You should encapsulate your iCustom calls to make your code self-documenting.
              Detailed explanation of iCustom - MQL4 and MetaTrader 4 - MQL4 programming forum

  2. Anthony Garot: otherwise, I use iCustom() to show me all the lines, averages, etc.
    MT4 ICustom doesn't show lines, you have to put the indicator on the chart to show them. Is MT5 any different?
Anthony Garot
413
Anthony Garot  
whroeder1:

  1. MT4 ICustom doesn't show lines

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.

Zee Zhou Ma
1585
Zee Zhou Ma  

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. 

Alain Verleyen
Moderator
29908
Alain Verleyen  
Alain Verleyen
Moderator
29908
Alain Verleyen  
SafMoseSteve
103
SafMoseSteve  
Alain Verleyen Is something wrong with the website? i can't see your replies or is it my laptop
12
To add comments, please log in or register