You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
The tools. Tell us about the tools, don't be embarrassing, I learnt from RaptorUK, dabbler, and SDC's comments the other day. So, please, tell us .
:D
It seems the answer to your question is Molanis . . . http://www.molanis.com/forum/viewtopic.php?f=2&t=1450
Interesting, as is this
https://www.mql5.com/en/forum/126224
It helps to know the background of what we are talking about!
I have been avoiding this thread because there is so much upset on all sides. It just seems so unnecessary.
Maybe the OP should start a new thread so respondents don't have to read 200 posts with 100% accuracy to figure out what is going on.
And maybe everybody could stop calling people names.
RaptorUK:
Day(), DayOfWeek(), TimeDay() and TimeDayOfWeek() all seem to work correctly in the Straegy Tester (build 427) . . . did you really mean to use Day() in your code or should your code building thing . . whatever it is that you use to code for you, should it have used DayOfWeek() ? the first, Day() gives a value 0 - 31, the second DayOfWeek() gives a value of 0 - 6 Sunday is 0
Interesting, as is this
https://www.mql5.com/en/forum/126224
It helps to know the background of what we are talking about!
I have been avoiding this thread because there is so much upset on all sides. It just seems so unnecessary.
Dooh! I glossed over that code and didn't see that problem, and I have used those exact functions in my own code. Well spotted :-)
Another thing we all didnt notice, well I did notice but in the midst of this crazy thread, I didnt realize no one had mentioned it, the OP posted this:
You cant string together all those || || || || || && && || && && as a condition without using some brackets to break it down.
Looking at the last part of it:
I dont believe that would ever cause the condition to be true when the previous parts were false, unless use some brackets to separate it from the rest of the condition.Another thing we all didnt notice, well I did notice but in the midst of this crazy thread, I didnt realize no one had mentioned it, the OP posted this:
You cant string together all those || || || || || && && || && && as a condition without using some brackets to break it down.
OK I had to check this now because I never wrote code like that and had it work the way I thought it would, so here is a simple script to test it.
I replaced each comparison in the original condition with corresponding comparisons of integers to make it easy to read/test/debug. All of it is false except the part after the last || operator.
That gives condition false which tells me:
As it was placed in the OP code, would never have made the condition become true even if Day() had been replaced with DayOfWeek() but if we put some parenthesis in there ....
Now it works and the condition becomes true.OK I had to check this now because I never wrote code like that and had it work the way I thought it would, so here is a simple script to test it.
Nice work. I also spotted that the MQL4 precedence rules ...
https://docs.mql4.com/basis/operations/rules
have logical OR higher than logical AND, in disagreement with K & R (2nd ed)
But like you, I never really use these to any great degree, I just put brackets around stuff or use separate lines so I can understand my own code!
Now it works and the condition becomes true.
And here is my contribution (test script) ...
Which does this ...
Clearly showing that the logical OR tests are done first (higher priority) and then the logical AND tests are done ... just like it says in the MQL4 documentation in fact :-)