Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 742

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Specifically here we need to look at.
Exactly here you need to look at.
The textbook says that a truncated datetime data value format is allowed.
I only need the time (hour+minute), not the date.
My question is. Am I correct in specifying a truncated datetime value format.
if(K1==-1502&&N==D' 19:00 ')
return;
This expression does not seem to work with me for some reason.
The textbook says that a truncated datetime data value format is allowed.
I only need the time (hour+minute), not the date.
My question is. Am I correct in specifying a truncated datetime value format.
if(K1==-1502&&N==D' 19:00 ')
return;
This expression doesn't seem to work with me for some reason.
The textbook says that a truncated datetime data value format is allowed.
I only need the time (hour+minute), not the date.
My question is. Am I correct in specifying a truncated datetime value format.
if(K1==-1502&&N==D' 19:00 ')
return;
This expression doesn't seem to work with me for some reason.
Since my post is in the quote, I'll have to answer it, though I don't know if it's correct or not. I've never used such a spelling.
Oh, and there's also a misunderstanding. If N is datetime type then D' 19:00 ' is text format. Can they be compared? No. In cases of time comparisons I write
And do not forget that a truncated format when converting into datetime type will be a full time.
This comparison is possible
And why not use integers
Thank you.
So instead ofdatetime, denote data of datetimetype by int type?
Since my post is in the quote, I'll have to answer that, although I don't know if that's right or not. I've never used such a spelling.
Oh, and there is one more thing that is not clear. If N is datetime type then D' 19:00 ' is a text format. Can they be compared? No. In cases of time comparisons I write
And don't forget that the truncated date format, when converted to datetime type, is already full time.
This may be a comparison.
Thank you.
So instead ofdatetime, denote data of datetimetype by int type?
Datetime type
Thedatetime type is intended to store the date and time as the number of seconds elapsed since January 01, 1970. It takes 8 bytes of memory.
So you can take the remainder of division by the number of seconds in hours, days or other needed time intervals. And then compare the integer with the whole
Thank you.
So instead ofdatetime, denote data of datetimetype by int type?
It's always better to use time in total number of minutes, if it is used for comparison with current time: minutes+hours*60+days*24*60+... etc. This kind of time is more convenient and unambiguous to use in your Expert Advisor,
19-00 is 19*60 minutes and 20-30 is 30+20*60
for example, current hours:
current minutes:
time in total minutes always works better if it is used to compare with the current time: minutes+hours*60+days*24*60+... etc. This kind of time is more convenient and unambiguous to use in an EA,
19-00 is 19*60 minutes and 20-30 is 30+20*60
for example, current hours:
current minutes:
Datetime type
Datetime is intended to store the date and time as the number of seconds elapsed since January 01, 1970. It occupies 8 bytes of memory.
So you can take the remainder of the division by the number of seconds in hours, days or other required time intervals. And then compare the integer with the whole
Datetime type
Datetime is intended to store the date and time as the number of seconds elapsed since January 01, 1970. It occupies 8 bytes of memory.
So you can take the remainder of the division by the number of seconds in hours, days or other required time intervals. And then compare the whole with the integer.
Then how do you understand their textbook example?
datetime Alfa = D'2004.01.01 00:00';
According to you, after the = sign there should be a set of digits representing the number of seconds from01.01.1970 - 01.01.2004.