True or False in external parameters, how do I?
-
FxDreema Hello! I wonder how can I have an option true or false so I can enable or disable some features of my EAs?
Until more!
-
Interesting, we have the same here: fxdreema.com/forum/viewtopic.php?f=2&t=1947
Well, the reason why I didn't added it to not make thing look too complex for newbies, and because numeric values of 0 and 1 can be used instead of boolean... most of the time. But because this is the third question for this feature I guess I must add it. -
Hm... I think I was confused the first time I read this question. What do you mean exactly?
-
Hello fxDreema.
What I mean is an external variable to enable and disable some external parameters, which in fact is nothing more than blocks. For example ... If I want to enable dynamic SL, put true in SL dynamic external parameter, but if I no longer want to use, put false to disable it. That for any external parameter of the EA.
How do I do that? Could you show me an example project?
Until more!
-
Welllll... my point of view is that fxDreema should not create single universal EA that is supposed to do everything. That was the reason why I started it - because I wanted to NOT try to create universal EA.
You can define external parameter and add it to Condition for example, this way you can change the path after that Condition depending on what is the value of that parameter.
I just added "Value (boolean)" to Condition, you can try this for example.But to change, for example "Stop-loss mode"... it's not impossible in theory, but I don't think it is a good idea. Actually I think I will disable external parameters for all drop-down menus in blocks. This is because they are represented as a string values, but they are nowhere documented.
-
Ok .. but in this case has the LeftOperand and RightOperand. Try but do not know if will work. I will test this way:
LeftOperand - Value Boolean - true == RightOperand - Value Boolean - true (imput parameter). In this case if it is true.
LeftOperand - Value Boolean - true == RightOperand - Value Boolean - false (imput parameter). In this case if it is false.Was this the correct way?
There would have only a block?
Until more!
-
Now it seems that there is no input field in "Value (boolean)" that we can assign to a Constant, because there is only one drop-down True/False menu. I winder if I have to make it possible to assign Constants and Variables to those drop-down menus... but nevermind.
http://fxdreema.com/shared/NiBgwlwC
Boolean datatype is not very different than a numeric 0 and 1, where 0 is false and 1 is true. We can use Value (numeric) when we work with boolean values and there are even no warning messages in MQL4. It just works. -
Hi I have done this way. This right also?
http://fxdreema.com/shared/FoXQuwu8Until more!
-
Well, this will work as well, only the name of the variable is automatically generated

-
Cool! I see I'm on the right track! Found more practical in this way.
Thanks fxDreema.