Errors, bugs, questions - page 99

 
Renat:

No.

If you created a variable int i;, why didn't you initialize it? In fact, you yourself said "I don't care what's in this variable" and ended up with rubbish in it.

The correct way is int i=0;

Yes, that's right - you may create such variables inside a block.
It is a habit. Earlier (in MQL4) int i; and int i=0; worked the same way. Eh....
 
Renat:
Please post a piece of code in servisdesk where this situation occurs.

I posted it in full (code), (when this line with this character "&" completely declare an error, and if you remove this character from the string completely, then everything works... Or at least half of the string for commenting then it will work with this character BUT!!! The length of the string of 159 characters. What is it then????) and try to declare it on Windows 7 64 bit (this is important) because the error occurs precisely on it, although before this Bild 306 I have 15 builds everything worked fine, on 305 - I worked with this code a week on this version of Windows everything was fine.



I have been writing to Service Desk for two days now and i can't get anything done...

P/S. They've already informed me they're working on it... (via ServiceDesk).


Документация по MQL5: Основы языка / Типы данных / Тип string
Документация по MQL5: Основы языка / Типы данных / Тип string
  • www.mql5.com
Основы языка / Типы данных / Тип string - Документация по MQL5
 

Quotes on Thursday 00:00 - 24:00. Friday 00:00 - ~22:45 .

How do I receive this information?

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

void OnTick()
  {
//---
//Print(TimeCurrent());      
datetime a,b;
SymbolInfoSessionTrade(Symbol(),FRIDAY,0,a,b);
Print(a,"-",b);
  }

Returns "2010.08.17 15:44:31 time (GBPJPY,H1) 1970.01.01 00:00:00-1970.01.02 00:00:00"

What is session_index, // session number, how do I know this number?

bool  SymbolInfoSessionTrade(
   string            name,                // имя символа
   ENUM_DAY_OF_WEEK  day_of_week,         // день недели
   uint              session_index,       // номер сессии
   datetime&         from,                // время начала сессии
   datetime&         to                   // время окончания сессии
   );
 
gumgum:

Quotes on Thursday 00:00 - 24:00. Friday 00:00 - ~22:45 .

How do I receive this information?

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

Returns "2010.08.17 15:44:31 time (GBPJPY,H1) 1970.01.01 00:00:00-1970.01.02 00:00:00"

What is session_index, // session number, how do I know this number?

See article Limits and checks in EAs
 


2010.08.17 17:35:37 time (EURUSD,H1) Monday: session index=0 start=00:00 finish=23:59:59

2010.08.17 17:34:58 time (EURUSD,H1) Friday: session index=0 start=00:00 finish=23:59:59

session_index is always zero

I still don't understand why session index!?

for(int i=0;i<=1000;i++)
{
datetime a,b;
if(!SymbolInfoSessionTrade(Symbol(),FRIDAY,i,a,b)){}else{Print(a," - ",b);}
}

Other than 0 it's always false.

 

Dedicated to the developers ...

You guys at least would have warned if you give an opportunity that before in principle was not possible.

I wasted twenty-four hours trying to catch this bug.

double            nd(double v)
{if(DIGITS=EMPTY_VALUE)DigitMinLots();// ставлю  if(DIGITS==EMPTY_VALUE) даёт расчёт с ошибкой
return(NormalizeDouble(v,DIGITS));
};

Don't tell me that it's okay. Of course I know that, but I've wasted 24 hours just because I'm used to the fact that with this

if(DIGITS=EMPTY_VALUE)

I'm used to getting the compiler to give me an error.

 
Urain:

Dedicated to the developers ...

You guys at least would have warned if you give an opportunity that before in principle was not possible.

I wasted twenty-four hours trying to catch this bug.

Don't tell me that it's okay. Of course I know that, but I've wasted 24 hours just because I'm used to the fact that with this

I'm used to getting the compiler to give me an error.

There is no error. The next update will give a warning that the expression is not logical.
 
mql5:
There is no error. In the next update, there will be a warning that the expression is not logical.
Now you're talking, there is no error myself.
 

Is there a forced termination of the OnTester() function

or why the history of transactions before the custom function exists and returns zero afterwards :

double OnTester()
  {
   int HTD=-1;
   Custom_func();
   if(HistorySelect(0,TimeCurrent()))HTD=HistoryDealsTotal();   
   return(HTD);
  }

what functions are not working in the tester ?

how can the tester (during optimisation) signal to the outside that something is wrong (print alerts, nothing works) ?

Документация по MQL5: Основы языка / Функции / Функции обработки событий
Документация по MQL5: Основы языка / Функции / Функции обработки событий
  • www.mql5.com
Основы языка / Функции / Функции обработки событий - Документация по MQL5
 

I don't get it, for the life of me.

Why is that: It's not over at 24:00 on a Friday.

Or what?

And why session_index++; if session_index=1 is already false:

//+------------------------------------------------------------------+
//|  Вывести информацию о котировочных сессиях                       |
//+------------------------------------------------------------------+
void PrintInfoForQuoteSessions(string symbol,ENUM_DAY_OF_WEEK day)
  {
//--- начало и конец сессии
   datetime start,finish;
   uint session_index=0;
   bool session_exist=true;

//--- пройдемся по всем сессиям за этот день
   while(session_exist)
     {
      //--- проверим наличие котировочной сессии с номером session_index
      session_exist=SymbolInfoSessionQuote(symbol,day,session_index,start,finish);

      //--- если такая сессия есть
      if(session_exist)
        {
         //--- выведем день недели, номер сессии и время начала и окончания
         Print(DayToString(day),": session index=",session_index,"  start=",
               TimeToString(start,TIME_MINUTES),"    finish=",TimeToString(finish-1,TIME_MINUTES|TIME_SECONDS));
        }
      //--- увеличим счетчик сессий
      session_index++;
     }
  }
Reason: