How to code the multiple values of an indicator into another indicator?

 

Let's use MACD as an example. It has 2-3 values(1 for the MACD line; the other for the signal line; 3 if it has a histogram).

I'm trying to incorporate those values into a new indicator. I figured I would need multiple buffers and SetIndexBuffer indicator calculations for the MACD indicator.

Need some help with all of the ins and outs.


Thanks in advance!

 
This is for MT5, but you can help out the MT4 peeps as well.
 
tradingmarkets4pips:

Let's use MACD as an example. It has 2-3 values(1 for the MACD line; the other for the signal line; 3 if it has a histogram).

I'm trying to incorporate those values into a new indicator. I figured I would need multiple buffers and SetIndexBuffer indicator calculations for the MACD indicator.

Need some help with all of the ins and outs.


Thanks in advance!

You're right. This must be done as you say. But maybe you don't need to use SetIndexBuffer. Just use the "CopyBuffer" function to get the MACD values.

https://www.mql5.com/en/docs/series/copybuffer

Documentación para MQL5: Acceso a las series temporales y a los datos de indicadores / CopyBuffer
Documentación para MQL5: Acceso a las series temporales y a los datos de indicadores / CopyBuffer
  • www.mql5.com
CopyBuffer - Acceso a las series temporales y a los datos de indicadores - Manual de referencia de MQL5 - manual de usuario para el lenguaje del trading algorítmico/automático para MetaTrader 5
Reason: