Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1006

 
Alexey Viktorov:

You have to read not only three lines of code but the text that explains everything clearly enough.

Reserved memory and array size are different concepts. If you override the array size with ArrayResize(arr,1000,1000); then the last element of the array will be 999 and no more. But if you need to increase the array's size, there will be no memory reallocation. If you don't need such a reserve of array size, make it smaller or don't reserve it at all.

So it's just extra memory that the function calls for from the processor additionally, it's just sitting idle, and it's not included in the array size. When you next increase by 1000 the program will work faster, it uses the reserve, if you write a second timeArrayResize(arr,2000); the array will increase to 2k but without reserve, copying elements will not occur and remove the old site too. Of course, I'd like the developers to at least show me pictures.

 

Good afternoon,


Can you please tell me why the separator "space" : " " is not visible?


File :

1



code :

2



result :

3

 

If you replace the tabs ; it's fine :

1


2


3

 
Artyom Trishkin:

Artem,

Do you know why it doesn't see the separator as a space ?

Maybe there is an alternative how to collect every element between tabs from the file ?


Thanks for the reply.

 
How does an EA formulate finding a Wedge (on 100 bars for example)?
 
Vladimir Baskakov:
How does an EA formulate finding a Wedge (on 100 bars for example)?
Паттерн Флаг
Паттерн Флаг
  • www.mql5.com
Характерная особенность паттерна Флаг, из-за которой он получил свое название, — заметное вертикальное движение цены ("флагшток") и затем размашистое горизонтальное движение — прямоугольное "полотнище" (рис. 1). В книгах и на сайтах, посвященных техническому анализу, паттерн Флаг часто рассматривается параллельно с паттерном Вымпел. Вымпел, в...
 

Why do indicator functions in MQL4, e.g. iATR, work in one EA and not in another? - I mean on multitemporal EA in the tester

I noticed (but I am not sure yet) that in the new format

void OnTick()
  {
   
  }

... these functions do not work ...


and in the old format

int start()
  {
   
   return(0);
  }

... work


Is it so and how to fix it?

 
Taras Slobodyanik:

print...

Thank you. I get the price of the trend line like this:

line0_price = NormalizeDouble(ObjectGetValueByShift("TrendUp",0),Digits);

How do I know the length of this line in bars?

 
yiduwi:

Thank you. I get the price of the trend line like this:

How do I know the length of this line in bars?

Time minus time divided by PeriodSeconds()

 
Alexey Viktorov:

Time minus time divided by PeriodSeconds()

Thank you.

Reason: