Easiest way to halt trading on stop loss being hit?

Back to topics list  | 1 2 To post a new topic, please log in or register
avatar
556
DomGilberto 2015.01.24 15:15 #
 

Yea I see. 

 Using this:

if(ClosedBySL) NextOrder = OrderCloseTime()+3600;


 How can I round UP "OrderCloseTime()" to the nearest hour in the example above?

avatar
1211
deysmacro 2015.01.24 15:25 #
 
Just for clarification, why the round up? Though I kinda knew the answer already.
avatar
735
honest_knave 2015.01.24 16:11 #
 
DomGilberto:

Yea I see. 

 Using this:


 How can I round UP "OrderCloseTime()" to the nearest hour in the example above?

There are many different ways, here is one:

#define HOUR 3600
...

if(ClosedBySL)
  {
   datetime ClosedAt = OrderCloseTime();
   NextOrder = ClosedAt - (ClosedAt % HOUR) + HOUR;
  }

 

avatar
12995
WHRoeder 2015.01.24 18:14 #
 
honest_knave: There are many different ways, here is one:
round number - MQL4 forum



Back to topics list   | 1 2  

To add comments, please log in or register