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).
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 // время окончания сессии
);
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++;
}
}
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.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).
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?
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 Limitations 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!?
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.
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.
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. In the next update, there will be a warning that the expression is not logical.
Is there a forced termination of the OnTester() function
or why the history of transactions before the custom function exists and returns zero afterwards :
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) ?
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?
See article Restrictions and checks in EAs
And why session_index++; if session_index=1 is already false: