Hi, everyone,
I am trying to code an EA for a trading system in a classical book, and need to use the Traditional MACD histograms. However, the backtest seems to be very slow when I use the Traditional MACD histograms. The code is
Could someone let me know which is better for predicting a trend, traditional MACD histograms or MT4's MACD?
Many thanks!
I am trying to code an EA for a trading system in a classical book, and need to use the Traditional MACD histograms. However, the backtest seems to be very slow when I use the Traditional MACD histograms. The code is
Inserted Code
double MACDLineBuffer[100]; double SignalLineBuffer[100]; double HistogramBuffer[100]; alpha = 2.0 / (SignalMAPeriod + 1.0); alpha_1 = 1.0 - alpha; for(int i=100; i>=0; i--) { MACDLineBuffer[i] = iMA(NULL,10080,FastMAPeriod,0,MODE_EMA,PRICE_CLOSE,i) - iMA(NULL,10080,SlowMAPeriod,0,MODE_EMA,PRICE_CLOSE,i); SignalLineBuffer[i] = alpha*MACDLineBuffer[i] + alpha_1*SignalLineBuffer[i+1]; HistogramBuffer[i] = MACDLineBuffer[i] - SignalLineBuffer[i]; }
Could someone let me know which is better for predicting a trend, traditional MACD histograms or MT4's MACD?
Many thanks!