[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 53

 
sergeev:


yes. it's called recursion.






Thank you wizard, I will try it. I am not a wizard yet and I am just learning.
 
tpg_k156:
Good afternoon. Do you know if it's possible to send code execution from line 35 to line 18 (lines for example) with the standard mql4 tools. A kind of jumping in the code.

The loop operator is intended for "jumping back".
A conditional statement is designed to "jump" forward.
 
Good afternoon, could you please advise how to make a check so that the EA cannot place orders every Friday after 6pm?
 
first_may:
Good afternoon, could you please advise how to make a check so that the EA cannot place orders every Friday after 6pm?
You could put a similar construction at the beginning of the Start function.
//---не давать коду советника работать в пятницу с 18-00 по серверному времени 
   if(DayOfWeek()==5 && Hour()>=18 && Minute()>0){
      
      return(0);  
   } 
 
granit77:
You can put a similar construction at the beginning of the Start function.




Thank you
 
An array (thousands of elements) is set locally in deinit().
What happens when MT4 finishes - does this data stay in memory or is it completely deleted?
I'm not interested in the data itself, but in the memory consumption.

Will deleting globally defined arrays lead to freeing up memory?
(during optimizations, for example).

Thank you!
 
yes
 
I would writeHour()>=18and throw out the minutes altogether.
 

In Inite I have it like this:

int signal[4] = {1, 2, 3, 4};

Here's the function:

//+-------------------------------------------------------------------------------------+
//| Получение общего сигнала на вход                                                    |
//+-------------------------------------------------------------------------------------+
int GetGeneralSignal()
{
   //int signal[4] = {1, 2, 3, 4};
   
   for(int i=0; i<4; i++)
  {
    if(GetStateMa(signal[i]) == MA_TALKING_LONG && IsRebound() == true)
      return(SIGNAL_BUY);
    
    if(GetStateMa(signal[i]) == MA_TALKING_SHORT && IsRebound() == true)
      return(SIGNAL_SELL);
  }
  
  return(SIGNAL_NO);
}

An error pops up during compilation:

'signal' - incompatible types   E:\Insall'd soft's\Forex\Alpari NZ MT4\experts\Base150.mq4 (146, 19)
'signal' - incompatible types   E:\Insall'd soft's\Forex\Alpari NZ MT4\experts\Base150.mq4 (149, 19)
2 ошибок, 0 предупреждений      

I don't understand what he doesn't like. The array in the init is already declared, the type of int... It's correct... What's wrong with it?

 
hoz:

In Inite I have it like this:

Here's the function:

An error pops up during compilation:

I don't understand what he doesn't like. The array in the init is already declared, the type of int... It's correct... What's wrong with it?


int signal[] = {1, 2, 3, 4};

int init(){

}

Consider the visibility of variables and arrays