This forum is in read-only mode now. You may discuss your questions on forums of MQL4.community and MQL5.community

praise, one possible bug and some suggestions


Back to topics list  | 1 2 3
avatar
39
davidwt 2005.08.29 06:55 
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?
avatar
239
Shimodax 2005.08.29 07:07 

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
avatar
39
davidwt 2005.08.29 07:34 
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?
avatar
239
Shimodax 2005.08.29 13:12 

David,

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


Markus


avatar
4464
Slawa 2005.09.01 12:07 
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
avatar
239
Shimodax 2005.09.01 12:13 

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
avatar
4464
Slawa 2005.09.01 17:32 

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
avatar
239
Shimodax 2005.09.01 17:35 

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
avatar
239
Shimodax 2005.09.01 22:11 

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

avatar
4464
Slawa 2005.09.02 18:06 
thanx for found bug!
Back to topics list   | 1 2 3  
Download MetaTrader 5 (450 Kb, web installer) — a new terminal for financial markets