How can I treat a parameter of MT4 EA settings in the source code

 

Hello,

I would like to know how can I treat a parameter from metatrader 4 platform definition instead of treat the error.


In the MetaTrader 4 we have a parameter that can set up the EA only to work with Long or Short positions, or the both.

Well, I would like to treat this parameter in my code to avoid the EA get the error.

Anyone can help?

 
Don't use that, create an input enumeration and use it.
 
William Roeder:
Don't use that, create an input enumeration and use it.

Really? this is the Metaquotes recomendations? this features look a garbage then.

 
Leandro Oliveira:

Hello,

I would like to know how can I treat a parameter from metatrader 4 platform definition instead of treat the error.


In the MetaTrader 4 we have a parameter that can set up the EA only to work with Long or Short positions, or the both.

Well, I would like to treat this parameter in my code to avoid the EA get the error.

Anyone can help?

It's possible but indirectly. You have to save a template, then parse it to get the setting you want. See this topic.

However I agree with William, it's simpler and faster to use an input parameter, unless you have a good reason to do otherwise.

 
Alain Verleyen:

It's possible but indirectly. You have to save a template, then parse it to get the setting you want. See this topic.

However I agree with William, it's simpler and faster to use an input parameter, unless you have a good reason to do otherwise.

ok, thank you for the contribute, I will do that.

Reason: