mql5 ""=="-open parenthesis expected" error
mql5 ""=="-open parenthesis expected" error
Loading saved threads...
celenkosini sibusiso · External communityPost link
External question — Stack Overflow Stack Exchange
Author: celenkosini sibusiso
Original post: https://stackoverflow.com/questions/79385363
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
The
CalculatePoint
function must determines the value of a "point" or "pip" for the current trading instrument by using the
Digits
variable which is a pre-defined variable. It must adjusts for symbols with 3, 5, 2, or 4 decimal places, returning 0.0001 or 0.01 as appropriate.
double CalculatePoint() {
if ((Digits == 3 || Digits == 5))
return 0.0001;
else if ((Digits == 2 || Digits == 4))
return 0.01;
else
return 1.0;
}
But I get an error - why?
"==" - open parenthesis expected
I added parenthesis as below but the problem is not resolved
double CalculatePoint() {
if ((Digits == 3 || Digits == 5)) {
return 0.0001;
} else if ((Digits == 2 || Digits == 4)) {
return 0.01;
} else {
return 1.0;
}
}
Quote
Report
Post Reply
Quoted from Forex.com.bd-Editorial External question — Stack Overflow Stack Exchange Author: celenkosini sibusiso Source score (net votes, not local likes): 0 Original post: https://stackoverflow.com/questions/79385363 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. The CalculatePoint function must determines the value of a "point" or "pip" for the current trading instrument by using the Digits variable which is a pre-defined variable. It must adjusts for symbols with 3, 5, 2, or 4 decimal places, returning 0.0001 or 0.01 as appropriate. double CalculatePoint() { if ((Digits == 3 || Digits == 5)) return 0.0001; else if ((Digits == 2 || Digits == 4)) return 0.01; else return 1.0; } But I get an error - why? "==" - open parenthesis expected I added parenthesis as below but the problem is not resolved double CalculatePoint() { if ((Digits == 3 || Digits == 5)) { return 0.0001; } else if ((Digits == 2 || Digits == 4)) { return 0.01; } else { return 1.0; } }
Checking account access…