praise, one possible bug and some suggestions - page 2

 
iCustom() gets called on every bar, it only loads the custom indicator on the first bar that iCustom() gets called on. This is per backtest run. When the optimizer runs, it is running several backtests (they may be running in different threads, I don't know). So, if there are 6 backtest runs during optimization, then there would be 6 loads of the custom indicator. Is this what you were talking about?
 
David

No. I think when iCustom is run with parameters passed to the custom indicator (the ones that refer to "..." in the iCustom call description in the help file) I believe the indicators is loaded on every call.


Markus
 
I think I was assuming you were talking about your expert during a backtest. Is the above log from a forward run of your expert?
 
David,

the log is from a backtest (times are faked backtest time, the first time column is running time).


Markus
 
same custom indicator but with other input parameter(s) considered as another custom indicator and will be loaded and calculated. in your case you need to use some function not custom indicator
 
Slawa,

I have used it with functions instead already.

However, in my case, the indicator was called with the same value every time (they were user inputs and the program did not modify them). I think it would be a good optimization to only reload the indicator if the parameter values are different.

Just a suggestion though ... I've already got it working.


Markus
 

I think it would be a good optimization to only reload the indicator if the parameter values are different.

up to 256 indicators can be loaded. if their number is less than 256 then indicators are not reloaded. if more than 256 first loaded indicator first unload
 
Slawa,

thanks for the info. I will double check this with my case to see if I did something wrong and will probably upload a test case.

Many thanks for your ongoing support.



Markus
 
Hello Slawa!

I think I found the source of the problem:

Here is how I call the iCustom:

      Print(gARO_Period, gBreakoutTolerance, gMinClusterBars, true, true);
      double d= iCustom(NULL, 0, "0-RossFX", gARO_Period, gBreakoutTolerance, gMinClusterBars, true, true, 0, 1);



The Print command always results in the same output, so the parameters are basically constant.

The following is a snippet from the indicator which is called (0-RossFX). If the parameters are called as above, the indicator is loaded for every call:

//---- indicator parameters
extern int gARO_Period= 20;
extern int gBreakoutTolerance= 5;
extern int gMinClusterBars= 10;
extern bool gShowOuterClusters= 1;
extern bool gShowInnerClusters= 1;





Now, if I change the paramters to the following with exactly the same code from the calling expert, the indicator is just loaded once (as it is to be expected):

//---- indicator parameters
extern int gARO_Period= 20;
extern int gBreakoutTolerance= 5;
extern int gMinClusterBars= 10;
extern [b]int[/b] gShowOuterClusters= 1;
extern [b]int[/b] gShowInnerClusters= 1;




This serves me fine as a workaround, but my conclusion is that MT4 Client has problem a problem when determinging if indicator needs to be reloaded if bools are present in the input parameter list.

Hope this helps.



Markus

 
thanx for found bug!