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
I just used phillip's code for the test without thinking of the specifics... But yeah, I agree MarketInfo() might affect the results. Redoing simpler tests and I'm getting inconsistent results as well. Strange... Don't know what to make of it.
Switch is great, if it only can test multiple conditions. Also why haven't I seen nested Switch used ?
I just used phillip's code for the test without thinking of the specifics... But yeah, I agree MarketInfo() might affect the results. Redoing simpler tests and I'm getting inconsistent results as well. Strange... Don't know what to make of it.
FYI, I don't seem to be getting absolutely identical output from MathRand() after using MathSrand(1). Over the course of your 1000000 iterations I'm sometimes seeing one or two values which are different across the two tests.
Over the course of your 1000000 iterations I'm sometimes seeing one or two values which are different across the two tests.
U sure? I can't seem to find any inconsistencies with MathRand()...
jjc it might be hardware related...as in a flipped bit in your ram somewhere...do you use ECC? not using oc'ed rig, are you? time to breakout memtest+ and prime95
U sure? I can't seem to find any inconsistencies with MathRand()...
" Gordon : For clarity's sake... A nested switch is almost always avoidable. "
--> Yep, besides that, not that easy typing it too, I don't see why if a Switch condition is fulffiled (1/more case's constant/s is met) we need the obligatory break? still ranks a distant 3rd in my list :)
" Phillip : I use nested switch to check symbol type (EURUSD vs GBPJPY, etc) followed by ordertype (Buy, Sell). Works just fine. Just have to mind the breaks."
--> As I mentioned the break IMHO makes it less convenient... BTW MQL5 introduced 'new' do...while... 'more options' now.
" Phillip : I use nested switch to check symbol type (EURUSD vs GBPJPY, etc) followed by ordertype (Buy, Sell). Works just fine. Just have to mind the breaks."
--> As I mentioned the break IMHO makes it less convenient... BTW MQL5 introduced 'new' do...while... 'more options' now.
Personally I like having the extra control and flexibility in engineering nested switches with the breaks. I hope they don't take this away in MQL5 (or whatever they are calling the metaquote language for MT5 platform).
Personally I like having the extra control and flexibility in engineering nested switches with the breaks. I hope they don't take this away in MQL5 (or whatever they are calling the metaquote language for MT5 platform).
flexibility doesn't come to mind, when I think of switch, if you care to show it / have some example, it would be awsome...
In my experience, Switch often cannot do without If, while If will sail through without the former.