Download MetaTrader 5
To add comments, please log in or register
The Market has more than 400 indicators. Try any of them!
assadar
16
assadar 2016.03.23 01: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";

Keith Watford
Moderator
7986
Keith Watford 2016.03.23 01: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.

assadar
16
assadar 2016.03.23 01: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
Keith Watford
Moderator
7986
Keith Watford 2016.03.23 02: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.

assadar
16
assadar 2016.03.23 02: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"));

Keith Watford
Moderator
7986
Keith Watford 2016.03.23 03: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.

assadar
16
assadar 2016.03.23 03: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
/
To add comments, please log in or register