Ea mq4 start time end time code

Back to topics list To post a new topic, please log in or register
avatar
5
assadar 2016.03.23 02:15
 

it is code not working 

 

   TimeToStr(TimeCurrent(), TIME_DATE) + " 00:00";

   TimeToStr(TimeCurrent(), TIME_DATE) + " " + Start1;

   TimeToStr(TimeCurrent(), TIME_DATE) + " " + End1;

   TimeToStr(TimeCurrent(), TIME_DATE) + " " + Start2;

   TimeToStr(TimeCurrent(), TIME_DATE) + " " + End2;

   TimeToStr(TimeCurrent(), TIME_DATE) + " 23:59";

avatar
Moderator
3405
GumRai 2016.03.23 02:33 #
 

What isn't working?

What are you expecting?

You don't assign to a string variable or print, we do not know what you are trying to do.

avatar
5
assadar 2016.03.23 02:42 #
 
Gumrai :

What isn't working?

What are you expecting?

You don't assign to a string variable or print, we do not know what you are trying to do.
I wonder how to run this code mq4
avatar
Moderator
3405
GumRai 2016.03.23 03:12 #
 

Please do not change my post into a foreign language and then quote it. I have changed it back to English.

There is no code to run. As I already said, we have no idea what you are trying to achieve.

It is like me posting

January

It is incomplete so it means nothing

now

The first Month of the Year= January

has a meaning.

avatar
5
assadar 2016.03.23 03:38 #
 
GumRai:

Please do not change my post into a foreign language and then quote it. I have changed it back to English.

There is no code to run. As I already said, we have no idea what you are trying to achieve.

It is like me posting

It is incomplete so it means nothing

now

has a meaning.

if (TimeCurrent() >= StrToTime("05:00") && TimeCurrent() < StrToTime("14:00")|| TimeCurrent() >= StrToTime("21:00") && TimeCurrent() < StrToTime("23:59"));

avatar
Moderator
3405
GumRai 2016.03.23 04:08 #
 

Now I can see what you are trying to achieve

You need to arrange your brackets

   if ((  TimeCurrent() >= StrToTime("05:00") && TimeCurrent() < StrToTime("14:00"))
      || (TimeCurrent() >= StrToTime("21:00") && TimeCurrent() < StrToTime("23:59")));

Insert the additional () as highlighted above

The highlighted ; at the end means that if the condition is met, nothing is done.

Remove the ;

   if ((  TimeCurrent() >= StrToTime("05:00") && TimeCurrent() < StrToTime("14:00"))
      || (TimeCurrent() >= StrToTime("21:00") && TimeCurrent() < StrToTime("23:59")))
         {
          //Your Code
         }

Not checked or tested.


avatar
5
assadar 2016.03.23 04:21 #
 
GumRai:

Now I can see what you are trying to achieve

You need to arrange your brackets

Insert the additional () as highlighted above

The highlighted ; at the end means that if the condition is met, nothing is done.

Remove the ;

Not checked or tested.


thank you sir
Back to topics list  

To add comments, please log in or register