DateTime function

 

Hello,


I work actually on an EA and I would like to check for some conditions each new minutes


I saw on a previous topic this script :


   static datetime Old_Time;
   datetime New_Time[6];
   bool IsNewBar=false;
   
   
   if(Old_Time!=New_Time[0]) // if old time isn't equal to new bar time
        {
         IsNewBar=true;   // if it isn't a first call, the new bar has appeared
            //--- Output a message to the Experts journal
            PrintFormat("IsNewBar = true",IsNewBar);
        }


At the end, on the backtest, the script "check" a new bar each hour (see attached file).

I would like to "check" a new bar each new minutes ... My question is : how to do ?

What part of the code should I modify ?


Thanks.

Files:
Sans_titre.jpg  84 kb
 

This article could help: https://www.mql5.com/en/articles/159

"New Bar" Event Handler
"New Bar" Event Handler
  • 2010.10.11
  • Konstantin Gruzdev
  • www.mql5.com
MQL5 programming language is capable of solving problems on a brand new level. Even those tasks, that already have such solutions, thanks to object oriented programming can rise to a higher level. In this article we take a specially simple example of checking new bar on a chart, that was transformed into rather powerful and versatile tool. What tool? Find out in this article.
 
MarketArt:

This article could help: https://www.mql5.com/en/articles/159

 

Thank you ;p

Very uselfull link

Reason: