netconuk posted # :
Consider the following:
Because your code has a single =, it is combining string && bool
You need to use
if (Trend=="UP" && Main_0 >40 )
Paul
AHHH! Of course. Many thanks Paul.
In MT4 it would warn you of creating an assignment within an IF block. Is this something that needs fixing in MT5?
-Jerry
AHHH! Of course. Many thanks Paul.
In MT4 it would warn you of creating an assignment within an IF block. Is this something that needs fixing in MT5?
-Jerry
Believe me, I've done it many times myself. I thought about the warning too - it's not entirely simple because your earlier code is legal C, so the warning would pop up in a rather irritating fashion every time you compile even for intentional instances. Microsoft Visual C++ does give a warning, but once that module is compiled and is left unchanged then you don't see the warning again unless you rebuild the entire project.
Paul
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Consider the following:
double Main_0;
string Trend;
..(bit of calculation here)
if (Trend="UP" && Main_0 >40 )
{
Do something
}
I don't see why I should get "implicit conversion from number to string" error in the IF statement. If I remove either Trend or Main_0 it compiles OK.
-Jerry