plus, subtract time code need help!

 

I dont know how to make a math with time.

Can anyone help me to code this :

oldtime=0;

if (oldtime+5(minutes)<TimeCurrent())

   {trade....

    oldtime=TimeCurrent()}


Thank you!

 
tamfic:

I dont know how to make a math with time.

   static datetime oldtime=0;
   if(oldtime+5*60<TimeCurrent())
     {
      trade....
      oldtime=TimeCurrent();
     }
Reason: