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

 
Artyom Trishkin:

The first thing to see (all in a "maybe" style) is what returns to you

Do you check that somewhere?

What about it in the help?

Are you sure you're getting the index?

I check it, but there's still an error somewhere, nothing changes.

close[i+1] <Low[iLowest(NULL,0,MODE_LOW,10,2)]&&iLowest(NULL,0,MODE_LOW,10,2)>0

 
Ghabo:

I check, there's still an error somewhere, nothing changes.


Like this.

iLowest(NULL,0,MODE_LOW,10,i+2)

try to find the index of the smallest value.

You're running it in a loop, aren't you?

 
Alekseu Fedotov:

Like this.

try to find the index of the smallest value.

You're running it in a loop, aren't you?

That's where the dog is at work) thank you.

 
Ghabo:

insert at the beginning of the code

Unfortunately, after these words 10 errors and 200 warnings pop up(((.

It compiles just fine.

 
Lomonosov1991:

Unfortunately after these messages 10 errors and 200 warnings will pop up((.

But it compiles just fine

Fix these errors - they tell you that the program is not written correctly - just in case.

 
Alekseu FedotovLike this.

The arrow is not set in real time, but it is when the settings are called up.

  {
//---
   if(rates_total<2) return(0);
   int limit=rates_total-prev_calculated;
   if(limit>2)
     {
      limit=rates_total-2;
      ArrayInitialize(BufferUP,EMPTY_VALUE);
      ArrayInitialize(BufferDN,EMPTY_VALUE);
     }
   for(int i=limit-2; i>=0; i--)
     {
      if(
         close[i+1] <low[iLowest(NULL,0,MODE_LOW,10,i+2)]&&iLowest(NULL,0,MODE_LOW,10,i+2)>0
         )
        {
         BufferUP[i+1]=low[i+1];
        }
     }

   return(rates_total);
  }

Why?

 
Ghabo:

The arrow is not set in real time, but it is when the settings are called up.

why?

if(limit>1)
 

Comrades! Maybe I do not understand something - and so should be in the tester for a pre-prepared template, I edit the value of the PCI indicator to the higher side, i.e. indicate 40.


During further testing, its value remains at 14 by default.


Is it supposed to be like this? Is it really necessary to re-save the template with the current value for the test each time?

 
Can't figure out how to fix the undeclared identifier error
Files:
 
Lomonosov1991:
Can't figure out how to fix undeclared identifier error

put static before double or declare one step above / globally.

If something is declared inside { }, then outside it "disappears".