Errors, bugs, questions - page 625

 

tester_file

string

File name for the tester, specifying the extension, enclosed in double quotes (as a constant string). The specified file will be passed to the tester for operation. Input files for testing, if needed, should always be specified

This is from the help. The"tester_file" parameteruniquely identifies the file name.

Hence the question: how can an EA be tested if several files have to be opened on read?

 

Hello!

This construct (for instance) :

if (Buf[i]>=0 && MACD_i<=0)

Operator1

.............

OperatorN


In this case, Operator1......OperatorN will always be executed

Since there are no opening parentheses after if (Condition) { }

When checking syntax errors, please make the compiler generate a warning on this issue.

Sometimes constructions are huge and multi-leveled and it is very hard to find an error in such cases.

 

If there is no { }, then Operator2 will always be executed... OperatorN

and Operator1 only when the condition is met.

This is a normal construction and a warning would be inappropriate here.

 

Fia:

Because constructions can be huge and multi-level and it is very difficult to look for an error then.

What (or who) prevents you from putting the missing { }?

 
Fia:

...

Because constructions can be huge and multi-level and it is very difficult to look for an error then.

Structure your code. Then the code will not be "huge and multi-level".
 

Hello!

Plz help, I'm stuck...

   handle=FileOpen(nam,FILE_CSV|FILE_READ);
   if(handle>0)
      {
      while(! FileIsEnding(handle))
         {
         sss=FileReadString(handle);
         Print(sss);
         for(x=2; x<=6; x++)
            {
            X=FileReadNumber(handle);
            Print(X);
            }
         }
      FileClose(handle);
      }

There is this code - read from CSV file (in the trailer). After FileReadString execute, it's not name of symbol (like in file), but long set of nothing. And here it is the end of the file. Separator is tab, so it explicitly shouldn't be specified in FileOpen, code table by default, number of characters - before separator (CSV). Where did I screw up - the code is a bit?

Files:
file.zip  1 kb
 
muallch:

Hello!

Please help, I'm stuck...

There is this code - read from CSV file (in the trailer). After FileReadString execute, it's not name of symbol (like in file), but long set of nothing. And here it is the end of the file. Separator is tab, so it explicitly shouldn't be specified in FileOpen, code table by default, number of characters - before separator (CSV). Where did I screw up - the code is a bit?

void OnStart()
  {
   string nam="file.csv";
   int handle=FileOpen(nam,FILE_CSV|FILE_READ|FILE_ANSI);

   if(handle<0)
     {
      Print("Неудачная попытка открыть файл по абсолютному пути");
      Print("Код ошибки ",GetLastError());
     }

   if(handle>0)
      {
      while(! FileIsEnding(handle))
         {
         string sss=FileReadString(handle);
         Print(sss);
         for(int x=2; x<=6; x++)
            {
            double X=FileReadNumber(handle);
            Print(X);
            }
         }
      FileClose(handle);
      }
  }
 

All because of FILE_ANSI?

Didn't notice the elephant, thank you!

Документация по MQL5: Стандартные константы, перечисления и структуры / Константы ввода/вывода / Флаги открытия файлов
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы ввода/вывода / Флаги открытия файлов
  • www.mql5.com
Стандартные константы, перечисления и структуры / Константы ввода/вывода / Флаги открытия файлов - Документация по MQL5
 
muallch:

tester_file

string

File name for the tester, specifying the extension, enclosed in double quotes (as a constant string). The specified file will be passed to the tester for operation. Input files for testing, if needed, should always be specified

This is from the help. The"tester_file" parameteruniquely identifies the file name.

Hence the question: how can we test an EA if several files must be opened for reading?

Or maybe you can suggest this too?
 
muallch:
Can you suggest this too?
Set some #tester_file in the programme