Too much Warning!
-
Hallo,
I know that are only "warning" and the EA work but**, if is possible, I would like to use a full compatible code for MT4.
**
Do you think is it possible please?These are all:
http://i.imgur.com/JJD0Imq.png%(#FF0000)[The first is about constant/block with bool variable:]
The worning: "expression is always false"
This is the bool constant:
http://i.imgur.com/KYOaRjw.pngAnd this the block control:
http://i.imgur.com/CwNxqw6.pngAnd this the code:
http://i.imgur.com/4dUdQFO.pngUsing bool in the constant I have not find a solution.
%(#FF0000)[The second is using constant to set TIME FRAME:]
I have try various solution but I cannot solve the warning!
I use the set time frame in more block (custom indi too). If I use the setting of the block There are no warning!
http://i.imgur.com/0aKWslR.png
And this is the code warning...
http://i.imgur.com/XZWXfY5.png
Thanks. Regards.
-
You can define those timeframe constants with data type ENUM_TIMEFRAMES and instead of values such as 60 and 15, you can use PERIOD_H1 and PERIOD_15. Plus, in the properties of the EA this parameter will appear in a better way, you will see
-
This is fantastic!!
.. I tried this way buy I had mistake something!
All is perfect now, many thanks!
If someone want more info about ENUM_TIMEFRAMES constant type this is a good link:
https://docs.mql4.com/constants/chartco ... timeframes
Please could you give me a confirmation about the "first problem" too (see my post) ?
I have find this solution, all work fine now without warning but I'm not sure if is the best way!!

I have set bool type for constant input but I have used int number (0,1) to compare in block:
TRUE IS = 1
FALSE IS = 0http://i.imgur.com/BnkwKVH.png
Many thanks!

-
Bool vs Int - this should work fine, even without warnings. 0 is false and 1 is true. Only when you start to mix floating numbers, strings or some exotics you can expect issues
