Download MetaTrader 5

help with mathpow()

To add comments, please log in or register
Agent86
914
Agent86  
MathPower() seems fairly straight forward

I'm getting "empty controlled statement found"

if(mlots >= MathPow(LotSize,3));
JC
1456
JC  
Agent86:
if(mlots >= MathPow(LotSize,3));

Not related to MathPow; it's the semi-colon in if(mlots >= MathPow(LotSize,3));

It's not valid syntax for an if statement. Same result if you write something like   if(true);    

MT4 interprets this as "if (condition) then... do nothing". If that's really want you want to write, for some reason, then the syntax which is acceptable to MT4 is  if (condition) {}

Agent86
914
Agent86  
jjc:

Not related to MathPow; it's the semi-colon in if(mlots >= MathPow(LotSize,3));

It's not valid syntax for an if statement. Same result if you write something like   if(true);    

MT4 interprets this as "if (condition) then... do nothing". If that's really want you want to write, for some reason, then the syntax which is acceptable to MT4 is  if (condition) {}

Thanks got it worked out

But now that it's working, I figured out I don't want to use that.
To add comments, please log in or register