Experts: FMOneEA - page 9

 
"I can't reproduce this issue."
=> Can it be that my terminal has a "Working Set (Memory): 706.480 K (directly taken from the task manager).

=> My logfile of today has the size of 390 KB with nothing but (MEZ):
0 21:45:10.396 ZigZag EURUSD,H4: uninit reason 1
0 21:45:10.396 Custom indicator ZigZag EURUSD,H4: removed
0 21:45:11.260 Custom indicator ZigZag EURUSD,H4: loaded successfully
0 21:45:11.264 ZigZag EURUSD,H4: initialized
0 21:48:54.694 ZigZag EURUSD,H4: uninit reason 1
0 21:48:54.694 Custom indicator ZigZag EURUSD,H4: removed
0 21:48:54.754 Custom indicator ZigZag EURUSD,H4: loaded successfully
0 21:48:54.758 ZigZag EURUSD,H4: initialized

=> I saved the ZigZag.mq4 under ZigZag_2.mq4 and applied it with its default variables to the chart, this indicator is running without any problem.

=> So I think it's not a problem of the ZigZag-indicator, nor 3rjfx' code - but it must be a feature of the terminal we do not know as there is no mq4-function that deletes a an indicator from the chart - only ExpertRemove(), but this would cause a 0 in the log-file.

=> I heard several times that an indicator once called CANNOT be 'removed from the chart' or from the terminal's memory as I once tried a recursive call of an indicator and crashes the terminal.

Is there a way to start terminal in a verbose mode?
 

Hi again  - I hope you don't mind,

but your code - which works perfectly!! - again reveals another mt4-mystery.

Several time you define logical variables within an if-branch (line 532-538):

   if((macddn==true) && (BSma02[0]<BSma06[0]) && (mamdn))
     {bool WaveDn=true;}
   if((macdup==true) && (BSma02[0]>BSma06[0]) && (mamup))
     {bool WaveUp=true;}
   if((!WaveUp) && (!WaveDn)) {return;}

1) The compiler does not complain - eventhogh WaveUp & WaveDn aren't defined at the same or a higher scope?

2) Thei values are correctly used eventhough they should be always false - not initialized?

if I write this (just an example!):

int OnInit() {
//--- create timer
   int i;
   string cmt;
   while(i-->0) {
      if (i>0.000000000000000001){
         double 
         const01 = 0.9762349,
         const02    = const01 * M_PI_2;
         cmt = StringFormat("1  t:%.3f => %.4f\n",const01,  const02);


      } else {
         const02 = 0.0;
      }
      if ( true || i>0.00001)  {
         cmt = StringConcatenate(cmt,StringFormat("2  t:%.3f => %.4f\n",
                                    const01,  const02));
     }
   }
   Comment(cmt);
      
//---
   return(INIT_SUCCEEDED);
}

The compiler grumbles:

'test_3.mq4'    test_3.mq4      1       1
'const02' - undeclared identifier       test_3.mq4      29      10
'const01' - undeclared identifier       test_3.mq4      33      37
'const02' - undeclared identifier       test_3.mq4      33      47
3 error(s), 0 warning(s)                4       1

In the mt4-reference I read:".. A variable declared inside a block (part of code enclosed in curly brackets) belongs to the local scope. Such a variable is not visible (and therefore not available) outside the block, in which it is declared."

rj3fx, do you have a mt4 celeb bonus? You would have deserved it.

;)

 
I have seen that you eliminated the ZigZag-indicator - hopefully not because of me and my complaint that ZigZag is constantly loade3d and removed.

The service desk told me:

Define your local arrays used by iMAOnArray as static

void FMOneCalculation() //-- function: Check trend and calculation order
{
//----
//--
ResetLastError();
RefreshRates();
//--
ConsBuy=false;
ConsSell=false;
SlashUp=false;
SlashDn=false;
SlashNt=false;
RedemUp=false;
RedemDn=false;
RedemNt=false;
//--
double bsOpen;
double bsClos;
static double MACDM[];
static double MACDS[];
static double MACDD[];
static double MACDU[];
static double BB200[];
static double BB201[];
static double BB202[];
static double BSma02[],BSma06[];
static double BSma14[],BSma30[];
ArrayResize(MACDM,cop1);
ArrayResize(MACDS,cop1);
ArrayResize(MACDD,cop1);


.... static double BSma2[],BSma4[];
ArrayResize(BSma2,cop1);
ArrayResize(BSma4,cop1);


This is because:
You have run into a constant re-calculation of OnArray indicators.

The indicators called from Expert Advisors are added to the "EA indicator pool". The pool may contain up to 256 indicators. If the indicator that is called at the moment is not present in the
pool, the oldest indicator is removed from it before adding the new one. This removal can be seen immediately provided that a custom indicator was ever used (like ZigZag in this case).

Unlike the old fourth version, when entering the function, all arrays are created anew taking the new IDs the OnArray indicators are bound to. When exiting the function, all OnArray indicators
become defunct. However, they are not removed from the indicator pool automatically turning into a trash.

...
We'll implement additional separate pool for OnArray indicators.
 
calli:

Hi again  - I hope you don't mind,

but your code - which works perfectly!! - again reveals another mt4-mystery.

Several time you define logical variables within an if-branch (line 532-538):

1) The compiler does not complain - eventhogh WaveUp & WaveDn aren't defined at the same or a higher scope?

2) Thei values are correctly used eventhough they should be always false - not initialized?

if I write this (just an example!):

The compiler grumbles:

In the mt4-reference I read:".. A variable declared inside a block (part of code enclosed in curly brackets) belongs to the local scope. Such a variable is not visible (and therefore not available) outside the block, in which it is declared."

rj3fx, do you have a mt4 celeb bonus? You would have deserved it.

;)

Hello Calli,

Thanks for your enlightenment, as appropriate instructions and explanations from the Service Desk.
I will immediately update according to the instructions.

Regarding Boolean variables are not defined at the same or a higher scope,
1) The compiler does not complain - eventhogh WaveUp & WaveDn aren't defined at the same or a higher scope?
2) Thei values are correctly used eventhough they should be always false - not initialized?

Several times I define a logical variable in an if-branch,
actually just to test gradually, at each level of status and position of the indicator.
If conditions are true, a boolean variable is declared, if not true, is not declared.
Because in MT4, sometimes, if the boolean variable declared simultaneously on higher scope,
(if) the latter, or (else) the last, will be taken as the most correct results.

Regarding MT4 celeb bonus .. it is I've been waiting ;)  ^_^  ^_^

Thanks and Regards.

 

Hello, 

I confused about what time frame use with the last vesion?! H4??

thanks 

 
I'm confused to here, in the description it says works only on H1, when you load the ea to chart you can read it works on all timeframes and then in the code itself it says recommendation to trade on H4....hmm so this is confusing i say!
 
Kenneth Parling:
I'm confused to here, in the description it says works only on H1, when you load the ea to chart you can read it works on all timeframes and then in the code itself it says recommendation to trade on H4....hmm so this is confusing i say!
Now it has reached the update 7, of course, is the setting used on the last update.
You do not have to think hard, you should use this EA on all timeframes, but I recommend using at H4 TF.
Hopefully you can understand what I say.
 
Facundo Laje:

Hello, 

I confused about what time frame use with the last vesion?! H4??

thanks 

Now it has reached the update 7, of course, is the setting used on the last update.

welcome

 

When is the best time of the day to run this EA on the default settings (update 7) on the H4 charts with most accuracy?

 

Thanks 

 
justin217:

When is the best time of the day to run this EA on the default settings (update 7) on the H4 charts with most accuracy?

 

Thanks 

This EA is not configured for trading at a specific time.
EA calculations based solely on price movements, and position indicator.

For EA used will trading the most accurate at the specific time, I suggest you should order and buy EA in the Freelance or MQL5 Market.

Regards.