title: Reversed array with MQL4
body: <p>With <kbd><strong>MetaTrader Terminal</strong></kbd> ( <strong><code>MQL4</code></strong> ), I try to have a reversed array, that I append ( prepend ) items to.</p>
  
  <p>So, on every tick, <strong><code>myArray[0]</code></strong> becomes the 'newest' value, and the previous value shifts to <strong><code>myArray[1]</code></strong> and so on.</p>
  
  <p>But its harder then it sounds.</p>
  
  <p>I tried like this -></p>
  
  <pre><code>       double myArray        = [];                        // GLOBAL Dynamic array
  extern int    maxArrayLength = 50;                        // EXTERN iterable
  
  // -----------------------------------------------------------------------
  bool   prependToReversedDoubleArray( double&amp; theArray[], double value, int maxLength ) {
  
         int size = ArraySize( theArray );                 // LOCAL size
         ArraySetAsSeries(     theArray, false );          // Normalize the array ( left to right )
         ArrayResize(          theArray, size + 1 );       // Extend array length
  
         Alert( "test = ", size );
  
         theArray[size] = value;                           // Insert the new value
         ArraySetAsSeries(     theArray, true );           // Reverse the array again
         if ( ArraySize(       theArray ) &gt; maxLength ) {
              ArrayResize(     theArray,    maxLength );
         }
         return( true );
  }
  
  prependToReversedDoubleArray( myArray, 0.1234, maxArrayLength );
  </code></pre>