Indicators: #MAMA

 

#MAMA:

Indicator #MAMA.

Author: Collector

 

Hello Collector,
are you sure you dont mix up the two buffers when you write the values just at the end of the code?
As I understand FAMA shall follow MAMA and I had to reverse them to get it right.

Tnx a lot for the contribution anyway!
Cheers.

 
I concur. FAMA and MAMA are around the wrong way.
 
FABuffer[i] = MAMA[1]; 
MABuffer[i] = FAMA[1]; 

Yes the two buffers are reversed.

If you look at MAMA at Ehlers_Technical_Papers you will see that the ratcheting action described (and below shown) is not occurring in the posted indicator (and image.)


This is because this indicator was translated from EasyLanguage. The two Arctangent calls were transliterated to MathArctan.
How ever, Arctangent returns degrees but MathArctan returns radians.
To fix, replace the two calls with Arctangent and define:

double Arctangent(double v){ return 360.0/M_PI_2*MathArctan(v); }
Ehlers_Technical_Papers
  • mesasoftware.com
  • www.mesasoftware.com
John Ehlers, the developer of MESA, has written and published many papers relating to the principles used in market cycles. Synopses for the papers available are displayed below. Download each by selecting their associated HyperText. Why Traders Lose Money (and What to Do About It) An article in the May 2014 issue of Stock & Commodities...
 
whroeder1:

Yes the two buffers are reversed.

If you look at MAMA at Ehlers_Technical_Papers you will see that the ratcheting action described (and below shown) is not occurring in the posted indicator (and image.)


This is because this indicator was translated from EasyLanguage. The two Arctangent calls were transliterated to MathArctan.
How ever, Arctangent returns degrees but MathArctan returns radians.
To fix, replace the two calls with Arctangent and define:


I've got an issue with this indicator.

I'm using the version including whroeder1's  suggested changes but when I add it to a chart, it correctly calculates for the existing bars but as soon as there is new data, it goes haywire:

Unfortunately I haven't been able to find the problem yet. Hopefully someone sees the problem.

I attached the .mq4 file.


Thanks.

Files:
MAMA.mq4  6 kb