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

 
Aleksei Stepanenko:


Not much wrong...

In your example Myfunc() works both ways

I think that's right

bool flag=false;
void OnChartEvent(...)
   {
   if(НажатиеНаКнопку) flag=true;
   }

int OnCalculate (...)
   {
      if(flag)
         {
         Myfunc(); flag=false;
         }
   }

void Myfunc()
   {
   
   }
 
Yes, there can be variations, depending on what is needed.
 
MakarFX:

Not much wrong...

In your example Myfunc() works both ways

I think that's right

bool flag=false;
void OnChartEvent(...)
   {
   if(НажатиеНаКнопку) flag=true;
   }

int OnCalculate (...)
   {
      if(flag)
         {
         Myfunc(); flag=false;
         }
   }

void Myfunc()
   {
   
   }

Why is it highlighted?

It's simpler this way

void OnChartEvent(...)
   {
   if(НажатиеНаКнопку)
     Myfunc();
   }

int OnCalculate (...)
   {
   }

void Myfunc()
   {
    // Делаем что душе угодно…
   }
 
Alexey Viktorov:

Highlighted for what?

It's easier that way, isn't it?

Agreed
 
MakarFX:

Here's what you need.

it's hard to understand the right section, can you help me figure it out?

 
How do I allocate memory to an array not in ontika?
 
Порт-моне тв:

it's hard to understand the right section, can you help me isolate it?


 
pribludilsa:
How to allocate memory to an array not in ontika?

I saw out of the corner of my eye that you had an issue with this. It doesn't seem to be a problem:

int a[];

int OnInit()
   {
   ArrayResize(a,10000,10000);
   }
 
Aleksei Stepanenko:

I saw out of the corner of my eye that you had an issue with this. It doesn't seem to be a problem:

Thank you. Right. I'm getting a little overheated.
 

You're welcome. It's hot as hell here too ;)