Can somebody please put this code into plain English for me (MT4)

 

Hi,

I code in C++ and am looking to interpret an MT4 indicator I found which I'd like to try on a system I have.

Please somebody explain what this code is saying in plain English for me


MovingBuffer[i]=iMA(NULL,0,LWMAPeriod,0,MODE_LWMA,PRICE_CLOSE,i)

      ATR_Buffer[i]=iATR(NULL,0,AtrPeriod,i+10);


Thanks!

Chris_P

 
Chris_P:

Hi,

I code in C++ and am looking to interpret an MT4 indicator I found which I'd like to try on a system I have.

Please somebody explain what this code is saying in plain English for me


MovingBuffer[i]=iMA(NULL,0,LWMAPeriod,0,MODE_LWMA,PRICE_CLOSE,i)

      ATR_Buffer[i]=iATR(NULL,0,AtrPeriod,i+10);


Thanks!

Chris_P

MovingBuffer and ATR_Buffer are (probably) global variables in your code.

iMA and iATR are built-in functions that return values of the corresponding indicators.

This sets value of the indicator for the bar "i" into the corresponding array at the index "i"


Check "Technical indicators"  and "Custom indicators" sections in the documentation.

Also, you might want to check "MQL4 Book"

iMA - Technical Indicators - MQL4 Reference
iMA - Technical Indicators - MQL4 Reference
  • docs.mql4.com
iMA - Technical Indicators - MQL4 Reference
 
Chris_P: Please somebody explain what this code is saying in plain English for me

Perhaps you should read the manual and look them up yourself.
          iMA - Technical Indicators - MQL4 Reference
          iATR - Technical Indicators - MQL4 Reference

 
Thank you both for your responses, much appreciated.
Reason: