help on adding minutes pending order

 

https://www.mql5.com/en/code/14883


I need this little help on this EA that puts pending orders on the hours, I would also like to add the minutes, thanks for your cooperation.

Pending Order
Pending Order
  • votes: 16
  • 2016.03.17
  • Widianto Pramana
  • www.mql5.com
Pending Order is an order that will be executed if the price touches a point that we specify, in other words open pending order means ordering to open a position at a certain price level. So if price hits a predetermined level, then automatically we have an open trading positions. At EA, there are 6 kinds of order types: Type 0 = Buy Type 1 =...
 
leonardo: I need this little help
Help you with what? You haven't stated a problem, you stated a want. Show us your attempt (using CODE button) and state the nature of your problem.
          No free help
          urgent help.
 

Hi

I hope my answer will be helpfull.

Currently this code will start trading between the 6th hour to the 20th hour, of the last known server time by the moment of the program start. So all you need to do to start trading on a minute is pretty simple.

add new variable.

extern int     Start_Minute              = 0;
extern int     End_Minute               = 59;

also include the function

int Minute_trade()
{
   bool trade = false;
   if(Start_Minute > End_Minute){
     if (Minute() >= Start_Minute || Minute() < End_Minute) trade = true;
   } else
     if (Minute() >= Start_Minute && Minute() < End_Minute) trade = true;

   return (trade);
}


And finally call the function we just created

replace line

if(Hour_trade()==1){

to line

if(Minute_trade()==1){


Now this will trade every 60 seconds.

 
thanks you understand the concept, go and try.
Reason: