title: Handling exceptions in MQL4
body: <p>In the <code>Java</code> language one can handle exceptions with a <code>try</code>-<code>catch</code> mechanism.</p>
  
  <p>Does it exist any similar behaviour in <strong><code>MQL4</code></strong>?</p>
  
  <p>This code throws the error '<strong><code>array out of range</code></strong>' in the <code>Close[bar]</code> expression and I cannot handle it properly.</p>
  
  <p>Any help will be appreciated.</p>
  
  <pre><code>bool isBarClosed( int bar ) {
      bool   barClosed  = true;
      double closePrice = Close[bar];
      int    error      = GetLastError();
  
      if ( error == 4202 ) {
          barClosed = false;
      }   
      return barClosed;
  }
  </code></pre>