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

 
No, I cleaned the recycle bin - nothing has changed. Can't see where there's more than 15 gigabytes of junk at all.
 
Dimka-novitsek:
No, I cleaned the recycle bin - nothing has changed. Can't see where there's more than 15 gigabytes of junk at all.

Clean with this. Run from the terminal folder.

Files:
clear.zip  1 kb
 
Thank you!!! I'll have a look. Oh, the brothers are here.
 
Dimka-novitsek:
Thanks, man. I'll check it out. Oh, the brothers are here.

That's the kind of dough you drive! It's high time you got yourself a stand-alone camper with an in-net line! IMHO!

 

Some advice. I couldn't find an answer on the forum, code library or on the internet, so I'm asking for help. Thank you in advance.

1) File operations. Excerpt from the textbook: A group of functions for file operations.

There are three directories (with subdirectories) in which working files can be located:

/HISTORY/<current broker> - specifically for the FileOpenHistory function;

/EXPERTS/FILES - general case;

/TESTER/FILES - especially for testing.

Working with files from other directories is suppressed.

Question: Are there any libraries, or commands, or other ways to make the EA access the directory the user specifies, i.e. access the directory I specify?

2) Question: Are there any commands or libraries in MQL4 that can be used to turn off the terminal by user's command, i.e., to specify certain conditions that will turn off the terminal. Not just shut down the Expert Advisor, but completely close the terminal???

 

Hello again!

Imagine where the hell the last expert disappeared to... This is what's left. Is it possible to get it back!

 
That is, the advisor of the latest version left behind a stupid two lines...
 

Please help me to understand the problem of finding divergence on the oscillators correctly. In this case let it be MACD. I have sketched out the following algorithm:

1) Count bars from the beginning and look for peaks on the oscillator:

   for(int i=limit; i=>0; i--)
    {
      MACD[i]=iMACD(Symb,TimeFrame,FastEMA,SlowEMA,5,PRICE_CLOSE,0,0) 
      
      if(MACD[i]>0)
       {
         if(MACD[i]>MACD[i-1] && MACD[i]>MACD[i-2] &&
            MACD[i]>MACD[i+1] && MACD[i]>MACD[i+2])
           {
            //--- здесь вносим в массив данные о баре, чтобы его можно было снова найти (1)
           }
       }
      if(MACD[i]<0)
       {
         if(MACD[i]<MACD[i-1] && MACD[i]<MACD[i-2] &&
            MACD[i]<MACD[i+1] && MACD[i]<MACD[i+2])
           {
            //--- здесь вносим в массив данные о баре, чтобы его можно было снова найти (2)
           }
       }

2) Create arrays containing peak times:

datetime Date_up[], Date_dn[];

and enter into them the MACD[i] value if the condition is fulfilled. The last new peak must have the index [n] and the penultimate one [n+1];

3) Let us consider a further solution under situation (1):

if(Date_up[n]<Date_up[n+1]
 { // находим индекс бара
  int i1=iBarShift(Symb,TF,Date_up[n],false);
  int i2=iBarShift(Symb,TF,Date_up[n+1],false);
  // находим пик на графике баров в пределах пяти баров
  double High1=iHighest(Symb,TF,MODE_HIGH,5,i1);
  double High2=iHighest(Symb,TF,MODE_HIGH,5,i2);
  
  if(High1>High2)
   {
    // ЕСТЬ ДИВЕРГЕНЦИЯ!!!
   }
 }

Actually, the problem with point 2: how to organize such an array like in a timeseries so that the values were shifted at every new peak?

 
merkulov.artem:

Some advice. I haven't found an answer on the forum, code library or on the internet, so I'm asking for help. Thank you in advance.

1) File operations. Excerpt from the textbook: A group of functions for file operations.

There are three directories (with subdirectories) in which working files can be located:

/HISTORY/<current broker> - specifically for the FileOpenHistory function;

/EXPERTS/FILES - general case;

/TESTER/FILES - especially for testing.

Working with files from other directories is suppressed.

Q: Are there any libraries, or commands, or other ways to make the EA access the directory the user specifies, i.e. access the directory I specify?

2) Question: Are there any commands or libraries in MQL4 that can be used to turn off the terminal by user's command, i.e., to specify certain conditions that will turn off the terminal. Not just turn off the Expert Advisor but close the terminal completely?

1.https://www.mql5.com/ru/code/10873

This library is for working with directories outside the sandbox. The file is created in a sandbox, you work with it, then translate it where necessary. You can copy, move (renaming), using a symlink to the directory you need, which is the same as a file or directory. I.e. create a symbolic link in the sandbox, work with it as with the directory of your file, then delete it, or not delete it if you need it.

2. https://www.mql5.com/ru/code/8577

This is an old library of WinAPI functions with MQL4 shell. All operations with files and directories. I do not recommend it. It is more reliable than the first one.

3. https://www.mql5.com/ru/code/9951

 // 2.2.1. Функция закрывает окно терминала МТ4. Функция возвращает TRUE, если сообщение поставлено в очередь, иначе - FALSE.
 bool ServiceMetaTraderClose();

==================

Artem, are you aware that nicknames with a dot are forbidden here? Your profile is not visible because of the dot.

 
...... <br / translate="no">

Artyom, are you aware that nicknames with a dot are forbidden here? Your profile is not visible because of the dot.


Thank you very much for the tip. Does it work only on Vista or on 7 too? or no one has checked?

I made my profile a long time ago, I didn't know about dot. I tried to edit it long time ago but error "Link does not work" appears. I wrote to support, but no answer. So I accepted it, it fulfills the main function :)

Reason: