Display the value of an array instead of its index value in mql4

 

Hi, I would like to display the value of an indicator instead of its index value. Here is the code that I have created. Somehow, it only display the index number. I would like to display the value of the index. For this code, I am using the Bulls Power indicator.

//highestValueForBulls
   double highestBullsArray[50];
   ArrayInitialize(highestBullsArray, 0);

   for(int i = 0; i < highestBullsArrayElementsCount; i++)
     {
      highestBullsArray[i] = iBullsPower(_Symbol, _Period, ibullspowerperiod, PRICE_WEIGHTED, i);
      highestValueForBulls = ArrayMaximum(highestBullsArray, WHOLE_ARRAY, 0);
     }

 
  1. Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
              General rules and best pratices of the Forum. - General - MQL5 programming forum
              Messages Editor

  2. Perhaps you should read the manual.
    The function returns an index of a found element taking into account the array serial. In case of failure it returns -1.

              Array Functions / ArrayMaximum - Reference on algorithmic/automated trading language for MetaTrader 5

  3. Compute the maximum after you populate the entire array.
  4. Once you have the index, read the array[index] for the value.
 
I have found a separate discussion regarding this issue: https://www.mql5.com/en/forum/113103
Reading indicator values from within an EA
Reading indicator values from within an EA
  • 2008.12.05
  • www.mql5.com
When writing an EA we often need the values of indicators to base our decisions on...