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

 
Dzmitry Zaitsau:
Alexey, thank you. I paid attention to punctuation first of all. The script has reduced to a minimum, left necessary for ObjectCreate()(anchor point, symv, AND TD). And it turns out that only in the header those constants in the code anywhere do not occur) on this and the question arose, why delete at least one error occurs. And the question arises, there may be mandatory conditions with a list of constants in the header. function header)))?

It even compiles like this

bool VLineCreate(const long            chart_ID=0,        // ID графика
                 const string          name="VLine",      // имя линии
                 const int             sub_window=0,      // номер подокна
                 datetime              time=0)            // время линии
 {
//--- если время линии не задано, то проводим ее через последний бар
  if(!time)
    time=TimeCurrent();
//--- сбросим значение ошибки
  ResetLastError();
//--- создадим вертикальную линию
  if(!ObjectCreate(chart_ID,name,OBJ_VLINE,sub_window,time,0))
   {
    Print(__FUNCTION__,
          ": не удалось создать вертикальную линию! Код ошибки = ",GetLastError());
    return(false);
   }
  return true;
 }
 
Alexey Viktorov:

It even compiles like this

))) That's what I thought it should compile. So I'm very careless then. Deleted a few times in different variations though. Thanks.
 

Can anyone suggest an SQL query. Why can't I write 0 in fifth column

   filename=_symbol()+(string)_Period+"_stats.sqlite";
   int database=DatabaseOpen(filename, DATABASE_OPEN_READWRITE | DATABASE_OPEN_CREATE | DATABASE_OPEN_COMMON);
   if(database==INVALID_HANDLE)
     {
      Print("SS: ", filename, " open failed with code ", GetLastError());
      return;
     }
   if(DatabaseTableExists(database, "DEALS"))
     {
      //--- создадим запрос и получим хендл на него
      int request=DatabasePrepare(database, "SELECT * FROM DEALS WHERE ID="+IntegerToString(i));
      if(!DatabaseBind(request,4,0))
        {
         PrintFormat("DatabaseBind() failed with code=%d", GetLastError());
         return;
        }
     }
   DatabaseClose(database);
DatabaseBind() failed with code=5625

 
Hi! Is there a day counting function with a difference between two dates, only that it changes the number every day?
 
ponochka:
Hi, is there a function for counting days with a difference between two dates, only that it would change the number every day?

Bars() look in the documentation.

int  Bars(
   string           symbol_name,     // имя символа
   ENUM_TIMEFRAMES  timeframe,       // период
   datetime         start_time,      // с какой даты
   datetime         stop_time        // по какую дату
   );
 

If we declare an array rez [10]; it forms a horizontal string 0,1,2,3, etc. If we declare a two-dimensional rez [10,10]; then it forms a horizontal and vertical string

0 1 2 3 4 5 .....

1

2

3

4

5

.... is my understanding correct ?

 
Aleksandr Egorov:

If we declare an array rez [10]; it forms a horizontal string 0,1,2,3, etc. If we declare a two-dimensional rez [10,10]; then it forms a horizontal and vertical string

0 1 2 3 4 5 .....

1

2

3

4

5

.... get it right ?

found the description correctly ?

 
Aleksandr Egorov:

found the description correctly.

It's a 2*2 matrix.

...........

...........

...........

...........

...

 
Aleksandr Egorov:

found the description correctly

)))
 
Dzmitry Zaitsau:
)))

what's wrong? ))))

Reason: