Errors, bugs, questions - page 1603

 
Vasiliy Sokolov:

You are very wrong about parsing.

You need to parse the date through your own date parsing function that understands the Excel format.

First you read it,

then parse,

then fill in the array structure.

OR

Read directly into the structure array ?

My task is to calculate profit by years, by months of each year, for different orders and take into account all types of orders and swap commissions.

So, I have something like

Year[].Month[].Day[].BuyProf.

Taking the date from the excel and buying it in year and month turned out to be nonsense....

The error was that there was a line break in some of the cells...

 
Vladimir Pastushak:

Read first,

then parse,

then fill in the array structure

OR

Read directly into the structure array ?

My task is to calculate profit by years, by months of each year, for different orders and take into account all types of orders and swap commissions.

So, I have something like

Year[].Month[].Day[].BuyProf.

Taking the date from the excel and buying it in year and month turned out to be nonsense....

The error was that there was a line break in some of the cells...

   int h = FileOpen(file_name, FILE_BIN|FILE_READ|FILE_SHARE_READ|common);
   uchar array[];
   FileReadArray(h, array, 0, WHOLE_ARRAY);
   FileClose(h);
   string text = CharArrayToString(array, 0, WHOLE_ARRAY, CP_ACP);
   string lines[];
   StringSplit(text, '\n', lines);
   for(int i = 1, k=0; i < count_lines; i++)
   {
      string columns[];
      StringSplit(lines[i], ';', columns);
      datetime date = ParseData(columns[0]);
      ///
   }
ParseData is your function. Next, parse the rest of the rows.
 

Abstraction error internal error #112 when compiling

#property library
void f() {}
void g() export { f; }
 

Compilation error

class A {};
class B : public A {};
void f( const A *a )
{
        const B *b1 =             (const B *)( a ); //error: 'const' - unexpected token
        const B *b2 = dynamic_cast<const B *>( a ); //нормально
}
 
Give reference in help todynamic_cast
 

How to change the location of quote bases in already installed terminal:

c:\Program Files\MetaTrader 5\Bases\ e.g. to d:\Bases\

Very clogged up, folders weigh 4-5 gigabytes :(

 
Anton Zverev:
Give reference in help todynamic_cast

Wow, is that in the 971 build dynamic_cast moved from the pros? I didn't know that.

At the end of the pagehttps://www.mql5.com/ru/docs/basis/types/casting

Документация по MQL5: Основы языка / Типы данных / Приведение типов
Документация по MQL5: Основы языка / Типы данных / Приведение типов
  • www.mql5.com
Основы языка / Типы данных / Приведение типов - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
Alexey Volchanskiy:

Wow, is that in the 971 build dynamic_cast moved from the pros? I didn't know that.

At the end of the pagehttps://www.mql5.com/ru/docs/basis/types/casting

Thanks, I'll look into it.
 
threat:

How to change the location of quote bases in already installed terminal:

c:\Program Files\MetaTrader 5\Bases\ e.g. to d:\Bases\

Very clogged up, folders weigh 4-5 gigabytes :(

Symbolic links to help.
 
Alexey Volchanskiy:

Wow, is that in the 971 build dynamic_cast moved from the pros? I didn't know that.

At the end of the pagehttps://www.mql5.com/ru/docs/basis/types/casting

I already saw that too, and by accident -https://www.mql5.com/ru/forum/1111/page1621#comment_2573188
Ошибки, баги, вопросы
Ошибки, баги, вопросы
  • reviews: 2
  • www.mql5.com
Форум трейдеров MQL5.community
Reason: