Errors, bugs, questions - page 1903

 
Vladimir Gribachev:

just opened the MT4 terminal in that development and was shocked

all the accounts are down - but it's fixable

I lost all the codes from the MetaEditor, and yesterday I failed to synchronize a couple of projects with the repository.

A day's work down the drain.

Can you comment on the situation?


it's the same on the other terminal.
 
In MqlRates the spread field is the minimum, maximum or average spread per bar? The documentation, as usual, rests.
 
Vladimir Gribachev:

All the codes from the Metadvisor are gone, and I still haven't synced a couple of projects with the repository yesterday.

Most likely not missing.

If the accounts are gone, almost certainly a new folder has been created in app data/roaming for the terminal data, just look in all the folders.

 
-Aleks-:

MT4 has started to crash frequently with a wind error (after an update?) - never seen this before, even if there was not enough memory - it just messed up in the calculations. Where to look for the problem?

Write to servicedex, we'll figure it out.
 

A question has arisen: how can I find out how many instances of the class there are?

The reason: there is a loop inside the class, inside which you only need to do some calculations if there is only one instance of the class, in other instances you need to skip such calculations to avoid duplicating them and doing unnecessary calculations (they were done in the very first instance of the class and shared - available outside the class)

 
Artyom Trishkin:

A question has arisen: how can I find out how many instances of the class there are?

The reason: there is a loop inside the class, inside which you only need to do some calculations if there is only one instance of the class, in other instances you need to skip such calculations to avoid duplicating them and doing unnecessary calculations (they were done in the very first instance of the class and shared - available outside the class)


Describe the static object counter in the class. In constructor - increase, in destructor - decrease.
 
Artyom Trishkin:

The reason is this: there is a loop within the class, within which you only need to do some calculations if there is only one instance of the class, in other instances you need to skip such calculations to avoid duplicating them and doing unnecessary calculations (they were done in the very first instance of the class and are shared - available outside the class)

Why not use a reference to a single instance of the class?

And inside - either calculate (when new data appears) or return the finished result.

 
Artyom Trishkin:

A question has arisen: how can I find out how many instances of the class there are?

The reason: there is a loop inside the class, inside which you need to do some calculations only if there is only one instance of the class, in other instances you need to skip such calculations to avoid duplicating them and doing unnecessary calculations (they were done in the very first instance of the class and shared - available outside the class)


Even better, all unique calculations should be moved to a separate class and make it a singleton.
 
Stanislav Korotky:

Even better is to put all unique calculations into a separate class and make it a singleton.

The calculation is not unique - if there is a single instance of the class then the calculation should be, if there are multiple instances then why duplicate the same calculation in other instances of the same class? It takes up resources.

At the same time, it is not optimal to make one more long cycle in a parent class to calculate the same data (two long cycles), and the child class will not be self-sufficient.

 
Andrey Khatimlianskii:

Why not use a reference to a single instance of the class?

And inside - either calculate (when new data appears) or return the finished result.

Andrey, can you be a little more specific? I don't quite understand.
Reason: