Errors, bugs, questions - page 324

 
Urain:

I didn't clarify this question at the time, and now I'm having doubts.

What's the right way to reserve memory?

like this

or as follows

And correct the help, it's very ambiguous.

ZS In the given variants it is implied that the size of allocated memory taking into account reservation should be 2016.

At the moment it works like this

ArrayResize(array,10,2000);

This will allocate a buffer for 2010 elements and 10 of them will be available.

This mayprobably change in the near future.

 
alexvd:

At the moment it works like this

This will allocate a buffer of 2010 items and 10 of them will be available.

Thismight change soon.

Why not 2000 buffers of which 10 are available?

This makes more sense in my opinion.

 
alexvd:

At the moment it works as follows

This will allocate a buffer of 2010 items and 10 of them will be available.

...

I get it, somewhere like this:

int reserved=0;// размер распределённой памяти
//+------------------------------------------------------------------+
//| изменение размера массива                                        |
//+------------------------------------------------------------------+
int Resize(int size)
  {
   int step=4;// резервирование с шагом 2^4=16
   int new_reserv=0;
   if((size>>step<<step)>=reserved)
     {
      reserved=((size>>step)+1)<<step;
      new_reserv=reserved-size;// сколько памяти нужно дорезервировать      
      ArrayResize(arr,size,new_reserv);      
     }
   else ArrayResize(arr,size);     
   Print("ArrayResize(arr,"+size+","+new_reserv+"); reserved="+reserved);
   return(size);
  }

...

This couldprobably change in the near future.

What's wrong with the current redundancy scheme?

 

I don't know if it's a bug or not, but when optimizing Expert Advisors based on a heavy indicator like CCFp(Cluster Indicator) at the end of the pass the following window pops up on the local agent: Strategy Tester Agent has stopped working.

When closing this window the program does not pop up and in a couple of seconds continues optimization, and the results of the pass are recorded in the report.

The following information is present in the EA code

void OnDeinit(const int reason)
{
IndicatorRelease(CCp_Handle);
}

If the IndicatorRelease(CCp_Handle); line is commented out, optimization goes without errors.

I am not good at programming, but my question is: When do I need to use this function in indicators and Expert Advisors? In my code of CCFp indicator it also uses deinitialization with releasing of handles of a heap of muvings.

Построение мультивалютного индикатора с применением множества промежуточных индикаторных буферов
Построение мультивалютного индикатора с применением множества промежуточных индикаторных буферов
  • 2010.05.17
  • Alexey Klenov
  • www.mql5.com
В последнее время возрос интерес к кластерному анализу рынка FOREX. MQL5 открывает новые возможности исследования закономерностей движения валютных пар. Важным преимуществом MQL5, по сравнению с MQL4, является возможность использования неограниченного количества индикаторных буферов. В данной статье описан пример построения мультивалютного индикатора.
Files:
optim.jpg  580 kb
 
52_rus:

I don't know if it's a bug or not, but when optimizing Expert Advisors based on a heavy indicator like CCFp(Cluster Indicator) at the end of the pass the following window pops up on the local agent: Strategy Tester Agent has stopped working.

When closing this window the program does not pop up and in a couple of seconds continues optimization, and the results of the pass are recorded in the report.

Please write to Service Desk. Attach source code and optimisation conditions.
 

Connection interruptions have become more frequent/longer.

 20110224

...

GI 1 Network 15:02:34 '728041': connection to MetaQuotes-Demo lost

HJ 0 Network 13:19:25 '728041': connecting to an access point with 83% quality (previous: 83%)

...


20110302

...

KJ 0 Network 08:53:17 '728041': scanning network for access points

IL 0 Network 08:54:14 '728041': scanning network finished

ME 0 Network 08:54:14 '728041': auto connecting to a better access point with 93 % quality (previous: 61 %)

LK 1 Network 08:54:14 '728041': connection to MetaQuotes-Demo lost

ES 0 Network 12:05:25 '728041': connecting to an access point with 92 % quality (previous: 0 %)

KN 0 Network 12:05:26 '728041': authorized on MetaQuotes-Demo via Access Point 1 Europe

MF 0 Network 12:05:26 '728041': terminal synchronized with MetaQuotes Software Corp.

OR 0 Network 15:08:22 '728041': scanning network for access points

QD 0 Network 15:09:18 '728041': scanning network finished

...


20110303

...

FI 1 Network 21:26:45 '728041': connection to MetaQuotes-Demo lost

PL 0 Network 10:10:49 '728041': connecting to an access point with 83 % quality (previous: 83 %)

...

 
I want to use external variables in the script so that I can set the required value before running it. In MT4 this was implemented using #property show_iputs, but in MT5 it is not possible (there is #property script_show_inputs, but it does not give anything). If anyone has faced such a question, please advise how to do it.
Документация по MQL5: Основы языка / Препроцессор / Свойства программ (#property)
Документация по MQL5: Основы языка / Препроцессор / Свойства программ (#property)
  • www.mql5.com
Основы языка / Препроцессор / Свойства программ (#property) - Документация по MQL5
 
DenisR:
I want to use external variables in the script so that I can set the required value before running it. In MT4 this was implemented using #property show_iputs, but in MT5 it is not possible (there is #property script_show_inputs, but it does not give anything). If anyone has encountered this issue, please advise how to do it.
Wouldinput variables work?
 
Yedelkin:
Wouldinput variables work?
Thank you, it all works.
 
DenisR:
I want to use external variables in the script so that I can set the required value before running it. In MT4 this was implemented using #property show_iputs, but in MT5 it is not possible (there is #property script_show_inputs, but it does not give anything). If anyone has encountered this issue, please advise how to do it.
Shit... The terminal comes with so many examples... ...so many examples... SymbolInfoSample.mq5 script, for example
Reason: