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
ah I think I got the Idea how to use switch case.
no 1 on above is referring to the sum of (B+C+D), so in this case if there's 2 bullish and 1 bearish the equation would be like this (1+1+2). The sum of this equation would be the case no like this,
is this right?
I think you are getting confused - please read the documentation on switch https://www.mql5.com/en/docs/basis/operators/switch
You must understand how it works first, so I suggest you write a test script
I will try to add some explanation here, but please do the above too
here you see sum == 1 so the if statement will always be false.
Actually, the if statement will always be true. False is zero, and true is non-zero. if(false || 4) equals if(4) equals if(true)
Actually, the if statement will always be true. False is zero, and true is non-zero. if(false || 4) equals if(4) equals if(true)
Ah yes good point - I was thinking of this scenario , which is how I usually explicitly write it:
I should have tested it be be sure.
Nevertheless, it makes me even more enthusiastic about wanting to bracket such statements!
I used switch case operator to determine a magic number on different timeframe like this,
because timeframe returns int with number of 5,15,30,60,240 it so the case number would be those numbers.
Let me tells you what I understand with this problem,
is this wrong?