thinkorswim ExpAverage vs. mql4

 

I wanted to convert ExpAverage in thinkorswim to mql4 function. I cannot seem to find any argument to iMA function which takes source. any idea?

I want to convert following small code to Mql4


def ap = hlc3;

def esa = ExpAverage(ap, 10);

def d = ExpAverage(AbsValue(ap - esa), 10);

def ci = (ap - esa) / (0.015 * d);

def tci = ExpAverage(ci, 21);

 

Perhaps you should read the manual. Start with iMA - Technical Indicators - MQL4 Reference and iMAOnArray - Technical Indicators - MQL4 Reference

No idea what hlc3 is, but PRICE_TYPICAL is (H+L+C)/3

No idea what ExpAverage is, but MODE_EMA is Exponential averaging.

You will need buffers for esa, |ap-esa|, d, ci, tci.

iMA - Technical Indicators - MQL4 Reference
iMA - Technical Indicators - MQL4 Reference
  • docs.mql4.com
iMA - Technical Indicators - MQL4 Reference
 
In MetaEditor's Navigator Include/MovingAverages.mqh you can see the averaging formulas used in MQL*.