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
Can I see the code, if you don't mind? I've tried it all ways, but it doesn't work.
I don't know whether it's easier to add the risk in percents of securities. I would like to use the code as an example and show the profitability of my trading robot.
Each case variant can be marked with an integer constant, a character constant or a constant expression. A constant expression may not include variables or function calls. A switch statement must be of integer type.
I gave you code that works without errors
I'm wondering why a construction like this doesn't work, it gives an error - '}' - not all control paths return a value
I gave you the code that works without errors.
I'm wondering why a construction like this doesn't work, it gives an error - '}' - not all control paths return a value
return(Lot);
What do you think this function should return? The way I see it -
It doesn't work like this.
This is how it works.
It doesn't work like this
Right and it doesn't work. It's up to everyone, but I personally have always believed that return() should be declared at the end of any function, and the compiler supports me in this.
PS
Personally, back in MQL4 I started using Result variable to calculate the return value. I should note that calling return() at the end of function code is mandatory and its presence in the beginning/middle of code will sometimes be perceived as some analogue of break (the only difference is that break itself isn't perceived by the compiler as a command to return the value of function's result).
It is not correct to use the == condition for variables of type double. It is recommended to compare like this: