title: MQL5 Invalid array access error when trying to access first element of an array
body: <p>I have a condition which checks if the latest fast moving average value is above or below the slow moving average and if the bid price is above or below the fast ma.
  But I am getting this compile error:
  <a href="https://i.stack.imgur.com/KmSKo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KmSKo.png" alt="enter image description here" /></a></p>
  <p>The iMA function is returning data.
  Here is my code:</p>
  <pre><code>int fast_ma_handle;
  int slow_ma_handle;
  
  int OnInit()
    {
     fast_ma_handle = iMA(_Symbol,_Period,8,0,MODE_EMA,PRICE_CLOSE);
     slow_ma_handle = iMA(_Symbol,_Period,21,0,MODE_EMA,PRICE_CLOSE);
    
     return(INIT_SUCCEEDED);
    }
  
  
  void OnDeinit(const int reason)
   {
  
  
   }
  
  
  void OnTick()
   {
     double fast_ma_array[], slow_ma_array[];
     int copied1 = CopyBuffer(fast_ma_handle,0,0,1,fast_ma_array);
     int copied2 = CopyBuffer(slow_ma_handle,0,0,1,slow_ma_array);
  
     double bid_price = SymbolInfoDouble(_Symbol,SYMBOL_BID);
     int trend_direction = 0;
  
     if(fast_ma_array[0] &gt; slow_ma_array[0] &amp;&amp; bid_price &gt; fast_ma_array)
        trend_direction = 1;
     else if(fast_ma_array[0] &lt; slow_ma_array[0] &amp;&amp; bid_price &lt; fast_ma_array)
        trend_direction = -1; 
    }
  </code></pre>
  <p>Thanks</p>