Errors, bugs, questions - page 2078

 

Wrote to the SD, has anyone noticed this in themselves? I directly copied the message

------------------------

Terminal version and bit rate

...1653

Description of the problem

...The cursor in the chart field sometimes becomes text instead of a pointer, i.e. a vertical stick, like in an editor.

Sequence of actions

...Occurs completely randomly. It helps to return to the standard trading chart bar. Sometimes this hovering becomes an arrow rather than a handle. And sometimes it will wiggle on the chart and returns to normal itself.

The result is as follows

...

Expected result

...

More info

Windows 10 Pro 1709 19299.64 x64, Observed on many terminals, different DCs. MT5 only runs in /portable on all of them. I use Punto Switcher. Also observed on clean terminals, without installed Expert Advisors and indicators.

 
The indicator does not unload
#property indicator_separate_window
#property indicator_buffers 0
#property indicator_plots indicator_buffers

int OnInit()
{
  return(INIT_FAILED);
}

void OnDeinit( const int )
{
  Print(__FUNCTION__);  
}

int OnCalculate( const int rates_total, const int, const int, const double &[] )
{
  return(rates_total);
}
 

Your post has successfully inserted a link to the reference. It says in the help:

Loading and unloading indicators

Indicators are loaded in the following cases:

  • attaching an indicator to a chart;
  • start of the terminal (if an indicator was attached to a chart before the terminal was previously closed)
  • loading of a template (if an indicator is attached to a chart)
  • Profile change (if the indicator is attached to one of the profile charts);
  • change of the symbol and/or period of the chart, to which the indicator is attached;
  • after the successful recompilation of an indicator, if this indicator has been attached to a chart.
  • change of indicator input parameters.

Indicators are unloaded in the following cases

  • when the indicator is detached from the chart;
  • closing of the terminal (if an indicator has been attached to a chart)
  • loading of the template if an indicator is attached to the chart;
  • close the chart to which the indicator has been attached
  • profile change, if the indicator is attached to one of the charts of the profile to be changed;
  • change of the symbol and/or period of the chart, to which the indicator is attached;
  • change of indicator input parameters.
 
Anton:

Your post has successfully inserted a link to the reference. The reference says it:

There is no mention of the other cases. Or add the word "only":"Indicators are unloaded only in thefollowing cases".

I will add this to complete the picture.

Forum on trading, automated trading systems and strategy testing

Peculiarities of mql5 language, subtleties and tricks

fxsaber, 2017.11.30 09:48

Memo

Action/type of programChange of TF or symbolAccount change
IndicatorRun OnDeinit and OnInit, global class object changes (full reset).Nothing happens except that prev_calculated is reset.
EARun OnDeinit and OnInit, global class object does not change.Run OnDeinit and OnInit, global class object changes (full reload).
 

FileFindFirst

Starts scanning the files and subdirectories in the appropriate directory according to the specified filter.

long  FileFindFirst(
   const string   file_filter,          // строка - фильтр поиска
   string&        returned_filename,    // имя найденного файла или поддиректории
   int            common_flag=0         // определяет область поиска
   );

If I set filter "*.bin", it gets all files with bin extension only. How to set filter to get only files without extension?

Документация по MQL5: Файловые операции / FileFindFirst
Документация по MQL5: Файловые операции / FileFindFirst
  • www.mql5.com
[in]  Фильтр поиска. В фильтре может быть указана поддиректория (или последовательность вложенных поддиректорий) относительно директории \Files, в которой необходимо проводить перебор файлов. [out]  Возвращаемый параметр, куда в случае удачи помещается имя первого найденного файла или поддиректории. Возвращается только имя файла (включая...
 
fxsaber:

If I set the filter "*.bin", it gets all files that only have a bin extension. How do I set the filter to get only files without an extension?

It seems that you can't. The filter has very limited options in this function.

But it is possible to filter additionally afterwards, because you have access to the name.

FindFirstFile function (Windows)
  • msdn.microsoft.com
Searches a directory for a file or subdirectory with a name that matches a specific name (or partial name if wildcards are used). To specify additional attributes to use in a search, use the FindFirstFileEx function. Syntax Parameters lpFileName [in] The directory or path, and the file name. The file name can include wildcard characters, for...
 
Комбинатор:

It seems that you can't. The filter has very limited options in this function.

But it is possible to filter additionally afterwards, the name can be accessed.

Thanks, I thought it could be done in one step.

 
fxsaber:

Thanks, thought you could do it in one go.


Doesn't work like that - "*." ?

 
Stanislav Korotky:

And that's not how it works - "*." ?

I checked this option straight away. It doesn't work.

 
fxsaber:

I checked this option straight away. It doesn't work.

It works in MT4.

Reason: