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
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
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:
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.
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.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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