Errors, bugs, questions - page 1210

 
ALXIMIKS:

Are the copy constructor and assignment operator even planned in any future???


The copy constructor is mentioned in the help at https://www.mql5.com/ru/docs/basis/types/classes

A default constructor has a specific purpose in initialising an array of objects of its class. A constructor whose parameters all have default values isnot a default constructor. Let's show this with an example:

//+------------------------------------------------------------------+
//| Класс с конструктором по умолчанию                               |
//+------------------------------------------------------------------+
class CFoo
  {
   datetime          m_call_time;     // время последнего обращения к объекту
public:
   //--- конструктор с параметром, имеющем значение по умолчанию, не является конструктором по умолчанию
                     CFoo(const datetime t=0){m_call_time=t;};
   //--- конструктор копирования 
                     CFoo(const CFoo &foo){m_call_time=foo.m_call_time;};
 
   string ToString(){return(TimeToString(m_call_time,TIME_DATE|TIME_SECONDS));};
  };

Документация по MQL5: Основы языка / Типы данных / Структуры и классы
Документация по MQL5: Основы языка / Типы данных / Структуры и классы
  • www.mql5.com
Основы языка / Типы данных / Структуры и классы - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
ALXIMIKS:

assignment operator at all planned in any future???


There is an overloading at https://www.mql5.com/ru/docs/basis/function/operationoverload.

To make it easier to read and write code, overloading of some operations is allowed. The overload operator is written with theoperatorkeyword . Overloading of the following operations is allowed:

  • binary +,-,/,*,%,<<,>>,==,!=,<,>,<=,>=,=,+=,-=,/=,*=,%=,&=,|=,^=,<<=,>>=,&&,||,&,|,^;
  • unary +,-,++,--,~;
  • assignment operator =;
  • indexing operator [].
Документация по MQL5: Основы языка / Функции / Перегрузка операций
Документация по MQL5: Основы языка / Функции / Перегрузка операций
  • www.mql5.com
Основы языка / Функции / Перегрузка операций - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 

Sorry for being inaccurate and for being vague about what I wanted to do.

Конструктор копирования и оператор присваивания вообще планируются хоть в каком-то будущем???

Basic class A has 15 fields, from it two descendants B and C - each has +5 more fields.

And the rest is a 20 minute quest.

I wanted to ask aboutimplicit copy constructors and assignment operators.

If they are there and I still haven't figured out how to use them, please poke your nose in (I'd appreciate it).

I know about explicitcopy constructors and assignment operators, and I've used them,

But i've wasted a lot of time, as it seems to me(i had a lot of fields, much more than in example),

though I used the best way of implementation (by reusing base class code).

 
ALXIMIKS:

I apologise for being inaccurate and wording loosely what I wanted.

I wanted to ask aboutimplicit copy constructors and assignment operators.

So I've got it wrong and the answer above was correct.

mql5:
Yes, we will, but it's not in our immediate plans yet.
 
Tapochun:
Thanks for the reply, that's exactly what I've done now. Apparently because the graphical construction is DRAW_NONE and the indicator is in a separate window, the two construction properties overlap, which causes the data in the subwindow to disappear. But if we use INDICATOR_CALCULATIONS, the data of buffers 1 and 2 will not be shown in the data window, but they can be accessed from the EA. We will have to sacrifice the data window)
This is not about DRAW_NONE. Your buffer data differs by three orders of magnitude, so MACD is just not visible against the price (scaled). It is on the screen though))
 
After the last terminal update (986, 26 September 2014) USDCHF and USDRUR started to appear in Market Watch on their own. I uninstall it, and after a while it reappears. Why?
 
Dima_S:
This is not about DRAW_NONE. Your buffer data is three orders of magnitude different, so the MACD is simply not visible against the price (scaled). It is on the screen though))
Thank you very much. This is very valuable information for me! Indeed, everything is logical! It's a pity the articles about proportionality of prices in buffers and display in one subwindow have no information ( although maybe I haven't noticed it myself ).
 

MT4 711 build

The script opens two new charts and runs 2 other scripts on them.

About once in 10 runs it crashes (I don't see the pattern):

2014.10.02 12:21:59.892 Script open_script GBPJPY,M5: removed
2014.10.02 12:21:59.892 open_2_script GBPJPY,M5: global initialization failed
2014.10.02 12:21:59.892 open_2_script GBPJPY,M5: Invalid EX4 file (9)
2014.10.02 12:21:59.890 Script open_script GBPJPY,M5: removed
2014.10.02 12:21:59.890 open_script GBPJPY,M5: global initialization failed
2014.10.02 12:21:59.890 open_script GBPJPY,M5: Invalid EX4 file (6)
2014.10.02 12:21:59.887 Script open_script GBPJPY,M5: loaded successfully
2014.10.02 12:21:59.878 Script open_script GBPJPY,M5: loaded successfully
2014.10.02 12:21:59.692 Two_orders_in_same_time GBPJPY,M5: initialized
2014.10.02 12:21:59.679 Script Two_orders_in_same_time GBPJPY,M5: loaded successfully

What could it be from? What does 6 in "Invalid EX4 file (6)" mean?

Thank you.

 
ALXIMIKS:

MT4 711 build

The script opens two new charts and runs 2 other scripts on them.

About once in 10 runs it crashes (I don't see a pattern):

What could it be from? What does 6 in "Invalid EX4 file (6)" mean?

Thanks.

We are investigating a similar problem - running with a configuration file. Sometimes EA fails to start with similar symptoms.

We haven't found the cause yet. As soon as we find it, we will fix it right away.

 
stringo:

We are investigating a similar problem - launching with a configuration file. Sometimes EA fails to start with similar symptoms.

We haven't found the cause yet. As soon as we find it, we'll fix it

A small delay between function calls to startSleep(50) scripts helped me;

Maybe the problem is different threads accessing the same program at the same time to load it

Insert mutex))