Values of an indicator

 

Could anyone please assist or knows whether there is a way to extract the value of of an indicator (doesn't matter which indicator), for each hour candle?

Example:

Hour candle - 2010/09/06

High: 1.2918

Low: 1.2789

Close: 1.2798

EMA (3): 1.2833 - THESE ARE THE VALUES I WANT TO EXTRACT

ROC (10): 0.0090 - THESE ARE THE VALUES I WANT TO EXTRACT

 

iCustom will do it well. Read maual - https://docs.mql4.com/indicators/iCustom.

If you're using any of inbult indicators, use other functions, like iMA, iRSI etc.


In basic case you can get data in a loop:

for ( int i = 0; i < NUMBER_OF_BARS; i ++ )

{

         VALUE = iCustom( Symbol(), PERIOD_H1, INDICATOR_NAME, ...INDICATOR_PROPERTIES..., INDICATOR_BUFFER, i );

}
 

Try Exporting the value of the Buffers. The value of the indicator would be stored in Buffers if the indicator is written correctly.

 

void IndicatorBuffers(int count)
Allocates memory for buffers used for custom indicator calculations. The amount of buffers cannot exceed 8 or be less than the value given in the indicator_buffers property. If custom indicator requires additional buffers for counting, this function must be used for specifying of the total amount of buffers. Link to the Book explanation.
 


Reason: