Code Help, Please Clarify

Back to topics list  | 1 2 To post a new topic, please log in or register
avatar
1206
FMIC 2016.04.18 19:31 #
 
angevoyageur:

False. It will be converted on today's date+hour like D'2016.04.18 01:30:00' for example.

Please do me a favour and first read the documentation, that you referenced. 
I stand corrected! However, in my defense, the documentation does not explicitly say that it will use today's date and and in fact it does imply the use of  "01.01.1970" when there is not a date present.
avatar
Moderator
3206
angevoyageur 2016.04.18 19:35 #
 
FMIC:
I stand corrected! However, in my defense, the documentation does not explicitly say that it will use today's date and and in fact it does imply the use of  "01.01.1970" when there is not a date present.
You should be more open and not so much on the defensive, there is nothing bad making an error. It's not normal I have to repeat it 3 times for you to listen.
avatar
44
mickeyferrari 2016.04.18 19:36 #
 

ok thanks all... 

#property strict

extern int
   StartHour =  1,    
   StopHour  = 21;

void OnTick()
{
   int CurrentHour = Hour(); // Assigned, just in case it is not buffered and the hour changes between calls
   
   if( ( CurrentHour >= StartHour ) && ( CurrentHour <= StopHour ) )
   {
      // Do Something Here
   } 

I will attempt to get it to work  

avatar
1206
FMIC 2016.04.18 19:48 #
 
angevoyageur:
You should be more open and not so much on the defensive, there is nothing bad making an error. It's not normal I have to repeat it 3 times for you to listen.

I would offer you the same advice as you have demonstrated the same "defensiveness" on another thread here where I too had to repeat myself several times to you!

So, lets call this hostility between us as "quits"! I will not be posting anything further today!

avatar
12988
WHRoeder 2016.04.18 19:53 #
 
mickeyferrari: what about this?
extern string StartTrade_A="15:00";
:
if((now >= StringToTime(StartTrade) && ...
FMIC: Your strings will convert as being on January 1st, 1970 which will obviously not match the current date.
  1. That will work (ignoring roll over to a new day.)
  2. No date is given, current date is used. When in doubt, test it.
    void OnStart(){ 
       Print(StringToTime("10:13"));
    
    // 2016.04.18 13:49:19.567 testscr EURUSD,H1: 2016.04.18 10:13:00
    
Back to topics list   | 1 2  

To add comments, please log in or register