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?

 
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.

 
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.

 
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
}
 
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 ?

 
Bilal Said:

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

Yes, it is.

 
  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?
 
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.

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

also here.

Reason: