Condition to only trade once per hour

 

Hello, does someone know a condition to trade only once per hour in mql5, i'm a begginer and having trouble to find something that i can undestand.

Or some ressource to learn more about it

Thank you


 
When in doubt, think!
static datetime lastTrade=0; datetime now=TimeCurrent();
if(now - lastTrade >= 3600){ // Only once per hour.
   lastTrade=now;
   OrderSend(…);
}
 
Bat Man:

Hello, does someone know a condition to trade only once per hour in mql5, i'm a begginer and having trouble to find something that i can undestand.

Or some ressource to learn more about it

Thank you


Example:  One deal per bar

Learning to code. Need help with this.
Learning to code. Need help with this.
  • 2020.08.21
  • www.mql5.com
I Wanted this EA to to buy and close at 20 ma crossings. Only buy when above 50 ma and ignore sells...
Reason: