iMACD() variation from MACD construction

 
Has anyone already brought up that iMACD is different from a constructed MACD? Not just how it's displayed, but the values are wrong. There are some other constructions out there (MACD_c2 is one, but it has an SMA instead of EMA for the signal line which needed to be corrected) for bar-to-bar comparison. the difference is subtle, but it's different. What does he guts of the iMACD() look like?
I built a MACD function in an EA using iMA() and iMAonArray() to get the correct functionality, and I'm happy with that, but I wondered if there's a plan to fix the iMACD() function. or if it's fine as it is, and I'm mistaken in the MACD construction method?

To reproduce the 'error', just build (or download from wherever) a MACD from scratch using iMA(), and compare it to iMACD() to see the difference (in values, the display is wrong too, but that matters much less in my opinion).

My understanding of MACD construction:
MACD main = ema12-ema26
MACD signal = ema9(MACD main)
Histogram = MACD main - MACD Signal
 
MACD signal is sma9(MACD main) not ema9
 
Thanks Stringo. What about the function? It doesn't line up with sma9 either.

Also, are these guys wrong? I always thought MACD signal was ema9 of the MACD:

StockCharts.com "Usually, a 9-day EMA of MACD is plotted along side to act as a trigger line. "

Incredible Charts "signal line is calculated as a 9 day EMA of the MACD line."

Wikipedia "A signal or trigger line is then formed by smoothing this with a further EMA. The standard period for this is 9 days,"

Thanks!
-Matt
 
first see 'macd and macd histogram'
and try to change parameters
 
stringo wrote:
first see 'macd and macd histogram'
and try to change parameters

that is fine for an indicator but how do you apply that for an EA? I have an EA i am trying to get an IMACD to work in, I dont think its triggering my signals right.


I have fast=9 med=12 and slow of 52.



The MACD is Not right.

double getMACD()
{
return (iMA(NULL,0,MACD_Fast,0,MODE_EMA,PRICE_CLOSE,0)-iMA(NULL,0,MACD_Slow,0,MODE_EMA,PRICE_CLOSE,0));
//return (iMACD(NULL,0,MACD_Fast,MACD_Slow,MACD_Signal,PRICE_CLOSE,MODE_MAIN,0));
}
 
double getSignal()
{
return (iMACD(NULL,0,MACD_Fast,MACD_Slow,MACD_Signal,PRICE_CLOSE,MODE_SIGNAL,0));
}
 
double getRSI()
{
return (iRSI(NULL,0,RSI_Period,PRICE_CLOSE,0));
}
 
double getMAFast()
{
return (iMA(NULL,0,MA_Fast,0,MODE_EMA,PRICE_CLOSE,0));
}
 
double getMASlow()
{
return (iMA(NULL,0,MA_Slow,0,MODE_EMA,PRICE_CLOSE,0));
}
 
 
bool isBuySignal()
{
signal=getSignal();
macd=getMACD();
rsi=getRSI();
mafast=getMAFast();
maslow=getMASlow();

}
There isn't any way that I can really think to test the accuracy of my indicator with this workaround.
 
ecathell wrote:
stringo wrote:
first see 'macd and macd histogram'
and try to change parameters

that is fine for an indicator but how do you apply that for an EA? I have an EA i am trying to get an IMACD to work in, I dont think its triggering my signals right.


I have fast=9 med=12 and slow of 52.



The MACD is Not right.

double getMACD()
{
return (iMA(NULL,0,MACD_Fast,0,MODE_EMA,PRICE_CLOSE,0)-iMA(NULL,0,MACD_Slow,0,MODE_EMA,PRICE_CLOSE,0));
//return (iMACD(NULL,0,MACD_Fast,MACD_Slow,MACD_Signal,PRICE_CLOSE,MODE_MAIN,0));
}
 
double getSignal()
{
return (iMACD(NULL,0,MACD_Fast,MACD_Slow,MACD_Signal,PRICE_CLOSE,MODE_SIGNAL,0));
}
 
double getRSI()
{
return (iRSI(NULL,0,RSI_Period,PRICE_CLOSE,0));
}
 
double getMAFast()
{
return (iMA(NULL,0,MA_Fast,0,MODE_EMA,PRICE_CLOSE,0));
}
 
double getMASlow()
{
return (iMA(NULL,0,MA_Slow,0,MODE_EMA,PRICE_CLOSE,0));
}
 
 
bool isBuySignal()
{
signal=getSignal();
macd=getMACD();
rsi=getRSI();
mafast=getMAFast();
maslow=getMASlow();

}
There isn't any way that I can really think to test the accuracy of my indicator with this workaround.

Looking further I think I have found that IOsMA may be the real MACD as noted by other sites.
Reason: