How to Get Histogram from MACD and Signal lines? New comment Mohammad Sh 2023.06.20 14:01 I successfully used the code below to get the last n values of MACD and Signal lines: CopyBuffer(handleMACD, 0, n, inputBufferNumber, bufferMACD); CopyBuffer(handleMACD, 1, n, inputBufferNumber, bufferSignal); However, I also need the Histogram line.How can I get the the last n values of the Histogram line? MACD - Oscillators - Technical Indicators - Price Charts, Technical and Fundamental Analysis - MetaTrader 5 Help www.metatrader5.com Moving Average Convergence/Divergence (MACD) is a trend-following dynamic indicator. It indicates the correlation between two Moving Averages of a... William Roeder 2023.06.20 14:22 #1 mohammad sh: However, I also need the Histogram line. Just compute it. histogrami = macd i - signali . Mohammad Sh 2023.06.20 14:39 #2 William Roeder #: Just compute it. histogrami = macd i - signali . double hist[3]; for (int i = 2; i >= 0; i--) { hist[i] = bufferMACD[i] - bufferSignal[i]; } I used the code above. It seems to work. However, when I try, double hist[n];I get invalid index value error. New comment
I successfully used the code below to get the last n values of MACD and Signal lines:
However, I also need the Histogram line.
How can I get the the last n values of the Histogram line?