title: How to calculate (add) datetime values in MQL4?
body: <p>With MQL4 I have troubles in handling <strong><code>datetime</code></strong>.</p>
  
  <p>What I want to do is put <code>datetime</code> in array by month or by year.</p>
  
  <p>For now I do in this way.</p>
  
  <pre><code>datetime myDate;
  
  myDate[0] = D'2010.01.01 00:00';
  myDate[1] = D'2010.02.01 00:00';
  myDate[2] = D'2010.03.01 00:00';
  myDate[3] = D'2010.04.01 00:00';
  .
  .
  </code></pre>
  
  <p>However I want to do this like this below</p>
  
  <pre><code>myDate[0] = D'2010.01.01 00:00';
  for (int i = 1;i &lt; 6 ;i+=){
      myDate[i] = myDate[i - 1] + 1year;
  }
  </code></pre>
  
  <p>in case of month,</p>
  
  <pre><code>myDate[0] = D'2010.01.01 00:00';
  for (int i = 1; i &lt; 12 ; i++){
      myDate[i] = myDate[i - 1] + 1month
  }
  </code></pre>
  
  <p><strong>Q:</strong> How do I calculate adding <strong><code>1month</code></strong> or <strong><code>1year</code></strong>?</p>