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
723
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
11295
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
1951
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
507
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
11295
Icham Aidibe  
Bilal Said:

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

Yes, it is.

whroeder1
17927
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
1951
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.

Alain Verleyen
36593
Alain Verleyen  
2018/02/08 00:20:48 Completed #1740814 Dettono
Alain Verleyen
36593
Alain Verleyen  
Подозрительная финансовая активность пользователя 'wulixiao2013': +30, fail P to 'wulixiao2013', email ''!='wulixiao2013'
SafMoseSteve
251
SafMoseSteve  
Alain Verleyen Is something wrong with the website? i can't see your replies or is it my laptop
Bilal Said
507
Bilal Said  
SafMoseSteve:
Alain Verleyen Is something wrong with the website? i can't see your replies or is it my laptop

also here.

12
To add comments, please log in or register