Errors, bugs, questions - page 217

 
Interesting:

This is most likely because ArrayInitialize() is intended to fill only arrays of a certain type, numeric arrays to be exact (most likely int or double).

Because the array has type ENUM_ORDER_TYPE call of ArrayInitialize will cause an error, saying that this method of call is not allowed.

In my opinion, there are two options in this case:

1. change the ENUM_ORDER_TYPE array type to int, and take it into account in the code (at least order types can easily be represented as int);

2. Independently implement "initialization" of the array.

The int type is OK, I want it to be initialized as well.
 
sergey1294:
Everything is OK with the int type, I would like this type to be initialized

Or write your own ArrayInitialize analog (as procedure or function, your choice), or ask developers to change ArrayInitialize logic (which they will unlikely agree to).

For example, you can organize a module that contains, say, ArrayInitializeOrderType() bool and similar functions, and then use them when necessary.

 
Interesting:

Or write your own ArrayInitialize analog (as procedure or function, your choice), or ask developers to change ArrayInitialize logic (which they will unlikely agree to).

For example, you can create a module which contains, say, ArrayInitializeOrderType() bool and similar functions, and then use them when necessary.

I understand all this, but I don't want to deal with it with crutches
 
sergey1294:
I understand all that, but I don't want to do it with crutches

I don't see it as "crutches", I'd rather see it as an extension of MQL5 functionality and creation of my own library.

I'm sure it's more convenient, reliable and ultimately faster.

Документация по MQL5: Основы языка / Функции
Документация по MQL5: Основы языка / Функции
  • www.mql5.com
Основы языка / Функции - Документация по MQL5
 
Interesting:

I don't consider it a "crutch", I'd rather see it as an extension of MQL5 functionality and creation of its own library.

I'm convinced it's more convenient, reliable and ultimately faster.

I'm still working with an int type array for storing signals.
 

Is there an error in fresh build 362 (02.12.2010)? Unexpectedly CopyTime function, 3rd variant, stopped working. The script gives out

2000

2000

-1

History is loaded, it is present on the chart. Everything worked in the previous build.

void OnStart()
{
        datetime dt[];
        datetime t1 = StringToTime("2010.11.01");
        datetime t2 = StringToTime("2010.11.02");
	Print(CopyTime(_Symbol, PERIOD_CURRENT, 1000, 2000, dt));
	Print(CopyTime(_Symbol, PERIOD_CURRENT, t1, 2000, dt));
	Print(CopyTime(_Symbol, PERIOD_CURRENT, t1, t2, dt));
}
Документация по MQL5: Доступ к таймсериям и индикаторам / CopyTime
Документация по MQL5: Доступ к таймсериям и индикаторам / CopyTime
  • www.mql5.com
Доступ к таймсериям и индикаторам / CopyTime - Документация по MQL5
 

This situation is as follows, we need to transfer datatime from indicator to Expert Advisor. I have found it via Globalvariable, but the issue is about possible loss of data due to type conversion.

Документация по MQL5: Основы языка / Типы данных / Приведение типов
Документация по MQL5: Основы языка / Типы данных / Приведение типов
  • www.mql5.com
Основы языка / Типы данных / Приведение типов - Документация по MQL5
 
dentraf:

This situation is as follows, we need to transfer datatime from indicator to Expert Advisor. I have found it via Globalvariable, but the issue is about possible loss of data due to type conversion.

Just write an explicit type conversion.
 
alexvd:
Just write an explicit type conversion.
Thanks a lot!
 

What are these errors?

7 leaked strings left
Abnormal termination

Reason: