Download MetaTrader 5

Error compiling a sample EA

To add comments, please log in or register
Baljit Oberoi
496
Baljit Oberoi  

I tried compiling an EA which is posted below

https://www.mql5.com/en/articles/100

The code is giving compilation error at the following (as wrong parameters count)

adxHandle=iADX(NULL,0,ADX_Period);

I do not see any issue with the statement. How do I fix the error? Error list is attached.

Step-By-Step Guide to writing an Expert Advisor in MQL5 for Beginners
Step-By-Step Guide to writing an Expert Advisor in MQL5 for Beginners
  • 2010.06.09
  • //www.mql5.com/en/users/olowsam">
  • www.mql5.com
The Expert Advisors programming in MQL5 is simple, and you can learn it easy. In this step by step guide, you will see the basic steps required in writing a simple Expert Advisor based on a developed trading strategy. The structure of an Expert Advisor, the use of built-in technical indicators and trading functions, the details of the Debug mode and use of the Strategy Tester are presented.
Files:
Errors.JPG 58 kb
Keith Watford
Moderator
9642
Keith Watford  

double  iADX(
   string       symbol,        // symbol
   int          timeframe,     // timeframe
   int          period,        // averaging period
   int          applied_price// applied price
   int          mode,          // line index
   int          shift          // shift
   );



The last 3 parameters are missing
Drazen Penic
2580
Drazen Penic  

Code from that page is for Metatrader 5.

You saved that code into a mq4 file so compiler uses MQL4 syntax. 

MQL5 and MQL4 are not 100% source code compatible. 

Fstrifoerr8
36
Fstrifoerr8  
Drazen Penic:

Code from that page is for Metatrader 5.

You saved that code into a mq4 file so compiler uses MQL4 syntax. 

MQL5 and MQL4 are not 100% source code compatible. 

It is like ex4 rename to mq4 and you will get source code:)))))))))))
Fernando Carreiro
2281
Fernando Carreiro  
Fstrifoerr8:
It is like ex4 rename to mq4 and you will get source code:)))))))))))

Not quite! Let us not confuse the OP with such comments which he will misinterpret!

The OP has just begun learning and it is difficult enough for him to distinguish between MQL4 and MQL5. No need to mislead and confuse him even more!

Fstrifoerr8
36
Fstrifoerr8  
Fernando Carreiro:

Not quite! Let us not confuse the OP with such comments which he will misinterpret!

The OP has just begun learning and it is difficult enough for him to distinguish between MQL4 and MQL5. No need to mislead and confuse him even more!

ok.

It was a joke. 

To add comments, please log in or register