Please take the time to search and read the documentation before posting ...
Returns integer numeric value closest from above
Returns integer numeric value closest from below
Rounds of a value to the nearest integer
- www.mql5.com
Hello,
thanks for reply but i saw this one and dont fit because Is for integer, i Need It for double
I dont need in this way, i do and example to be clear
Lotsize 0.01 martingale 1.5
With Mql4 i have this steps as default Round the double value
0.01
0.01
0.02
0.03
I Need to have the same for mql5
Lotsize 0.01 martingale 1.5
With Mql4 i have this steps as default Round the double value
0.01, 0.01, 0.02, 0.03
I Need to have the same for mql5
You have not explained anything clearly at all.
Besides, the function works exactly the same on both MQL4 and MQL5.
void OnStart() { double dbSeed = 1.0, dbRatio = 1.5, dbStep = 0.01; for( int i = 0; i < 10; i++ ) { PrintFormat( "Lots: %.2f (Value: %.6f)", MathFloor( dbSeed ) * dbStep, dbSeed ); dbSeed *= dbRatio; }; };
Lots: 0.01 (Value: 1.000000) Lots: 0.01 (Value: 1.500000) Lots: 0.02 (Value: 2.250000) Lots: 0.03 (Value: 3.375000) Lots: 0.05 (Value: 5.062500) Lots: 0.07 (Value: 7.593750) Lots: 0.11 (Value: 11.390625) Lots: 0.17 (Value: 17.085938) Lots: 0.25 (Value: 25.628906) Lots: 0.38 (Value: 38.443359)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello guys,
how can i round a double to lowest number?
I have issue for lotsize in martingale 1.5
Starting from 0.01 i have
0.01 * 1,5 = 0.015 (i want round down to 0.01)