[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 113

 

Friends, there is a question:

TimeHour - Returns an hour for a specified time.

Does it understand the value of both 0 and 24?

If written:

extern double TimeStart = 24.0;

if (TimeHour(TimeCurrent()) >= TimeStart )
   {
    ...
   }

This function is feasible?

Or you need another condition: if (TimeStart >= 24.0) TimeStart = TimeStart - 24.0;

extern double TimeStart = 24.0;

if (TimeStart >= 24.0)  TimeStart = TimeStart - 24.0;

if (TimeHour(TimeCurrent()) >= TimeStart )
   {
    ...
   }
Can the first option work properly? Or should the second be done?
 
from zero to 23, interspersed, so no commas are necessary (it won't take them anyway)
 
FAQ:
Zero to 23, interjector, so no commas ( it won't work anyway)

Got it. Thank you!
 

Good afternoon!

Can you please tell me if it is necessary to install the terminal every time, or is it enough to install it once and then copy it to folders with different names?

(Windows 7x64 system)

Thanks in advance!

 
nilva:

Good afternoon!

Do I have to install the terminal every time, or is it enough to install it once and then copy it to folders with different names?


No, it is not necessary.

Make as many copies as you need.

 

Please advise!

How to insert this function:

во внешних параметрах 
extern int StartHour = 0;
extern int StartMinute = 0;
extern int StopHour = 23;
extern int StopMinute = 55;
extern int StartingTradeDay = 0;
extern int EndingTradeDay = 7;


и сама ф-ция 
int IsTradeTime() {
int li_8;
if (DayOfWeek() < StartingTradeDay || DayOfWeek() > EndingTradeDay) return (0);
int li_0 = 60 * TimeHour(TimeCurrent()) + TimeMinute(TimeCurrent());
int li_4 = 60 * StartHour + StartMinute;
li_8 = 60 * StopHour + li_8;
if (li_4 == li_8) return (1);
if (li_4 < li_8) {
if (!(li_0 >= li_4 && li_0 < li_8)) return (0);
return (1);
}
if (li_4 > li_8) {
if (!(li_0 >= li_4 || li_0 < li_8)) return (0);
return (1);
}
return (0);
}

in this indicator:

so that the conditions are fulfilled not by "D1" but by a certain time?

Thanks in advance!

Files:
fgsdpx500.mq4  5 kb
 

Developers, please do something to make it visible.


 
BeerGod: Developers, please do something to make it visible.

It's no use, those who can't see won't see until you poke your nose in.

 
Oh how I understand ...
 
I recently opened an account with GlobalFX and downloaded the minute quotes it gave, from March 7 to May 10, a total of 47 working days. I converted them to all timeframes up to the days with the attached script and got 56 daily candlesticks. It would seem that the number of daily candlesticks should be equal to the number of working days, but the difference is 9 candlesticks. Please advise how could such a discrepancy occur? I have some vague suspicions...
Reason: