0.1 is 're-converted' to an int and so 0.1 becomes a rounded 0.
Carl Schreiber:
0.1 is 're-converted' to an int and so 0.1 becomes a rounded 0.
I changed variable type to 'double' and problem solved! thanks!!
0.1 is 're-converted' to an int and so 0.1 becomes a rounded 0.
Carl Schreiber: 0.1 is 're-converted' to an int and so 0.1 becomes a rounded 0.
You have the right idea, but no it never gets re-converted. It remains an integer during the entire process. It carries out integer division, not floating-point division.
In integer division, if the divisor is greater than the numerator, then the results are always 0.
int risk_percent
Of course, it does.
On MT4 v434, division quotient don't give floating point values(Bug??) - MQL4 programming forum 2012.09.18
build 2504 & 2506 Bug - General - MQL5 programming forum - Page 2 #17

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
hi
Look at this part of code. It prints 0. I don't know why!
Any idea?