iRSIonArray()

 
I can't get this function to work - it returns results quite different from iRSI(). Does anyone have any code examples of how to use iRSIonArray()?

And yes, I am using ArraySetAsSeries() on the array before passing to iRSIonArray() ;). Here is an example:



Thanks,
Alan
  double aPriceArray[30], aRSI[30],aRSI2[30];
  int x;
  
  ArraySetAsSeries( aPriceArray, true );
        
  for( x = 0; x < 30; x++ )
   aPriceArray[x] = iClose( "GBPUSD", 43200, x );

  for( x = 0; x < 30; x++ ) {
    aRSI[x] = iRSIOnArray( aPriceArray, 0, 14, x ); // Calculate using array
    aRSI2[x] = iRSI( "GBPUSD", 43200, 14, PRICE_CLOSE, x ); // Calculate using chart data

    // This prints out two quite different results
    Print( "bar: " + x + ", RSI: " + aRSI[x] + ",  " + aRSI2[x] );
  }   






 
I think some of your code is missing
 
Sorry, fixed. I just yanked the code from an EA and visually edited it. This time I put the code in a new EA and compiled it. Works now.
Reason: