is it possible to dynamically evaluate code in mql5?

 

Hello, I would like to know if is it possible to dynamically evaluate code in mql5?

I mean in the same way you can do with Javascript and PHP with the "eval(...)" function?

Reference: http://www.w3schools.com/jsref/jsref_eval.asp


Regards, cyberglassed.

JavaScript eval() Function
  • www.w3schools.com
Free HTML CSS JavaScript DOM jQuery XML AJAX Angular ASP .NET PHP SQL tutorials, references, web building examples
 
cyberglassed:

Hello, I would like to know if is it possible to dynamically evaluate code in mql5?

I mean in the same way you can do with Javascript and PHP with the "eval(...)" function?

Reference: http://www.w3schools.com/jsref/jsref_eval.asp


Regards, cyberglassed.

seems not, what would you use it for?
 
Eliy Arlev:
seems not, what would you use it for?
Possibly to dynamically evaluate the code for the same reason you would be doing it in Java.  Not sure what good it does either, tbh, but apparently someone had a reason for it at one point.
 
Eliy Arlev:
seems not, what would you use it for?
I wanna load code from an external file based on some criteria.
 
cyberglassed:
I wanna load code from an external file based on some criteria.

I am not sure that there is a way to load code into the program only if certain conditions are met, but I know you can code your EAs to use external libraries as code resources.  You can also use include files to accomplish this.

https://www.mql5.com/en/docs

MQL5 Reference - How to use algorithmic/automated trading language for MetaTrader 5
MQL5 Reference - How to use algorithmic/automated trading language for MetaTrader 5
  • www.mql5.com
MetaQuotes Language 5 (MQL5) Reference - Documentation on MQL5.com
 
cyberglassed:
I wanna load code from an external file based on some criteria.

There is no eval() in MQL4/5. Please see this forum thread.

However, if you want to load code based on a certain criteria, you can use conditional compilation.

 
Enrico Lambino:

There is no eval() in MQL4/5. Please see this forum thread.

However, if you want to load code based on a certain criteria, you can use conditional compilation.

thanks Enrico.
Reason: