BUILDING AN EA

 

Good day to everyone. I want to make an EA based on ADX. I want to ask if how to code using ADX indicator? thank you. I mean what are the necessary parameters? it's like if the ADX 14 is above level 25, it will execute position based on another trend following indicator. 

Thank you and God Bless you all.

NIECO P. PAMA

 
You can use this code
int ADXPeriod = 14; 
double ADXMain = iADX(NULL,0,ADXPeriod,PRICE_CLOSE,MODE_MAIN,0);

if( ADXMain > 25 )
   {
      // do something
   
   
   }
 
I assume you use MT4, if you use MT5, the code will be different
 
Biantoro Kunarto:
I assume you use MT4, if you use MT5, the code will be different
Thank you very much sir for being generous. God Bless you...
Reason: