Alberto_jazz:
HI all, I need to round Bid to the highest and lowest value, as in this example
Bid = 1.24231
I need to obtain 1.24300 (upper round) and 1.24200 (lower round).
I’m trying to use MathRound() and NormalizeDouble() but it doesn’t work.
Could you help me? Thanks!!!
Try this . . . .
double NewBid; NewBid = MathRound(Bid * 1000) / 1000;
You want to round to the nearest 0.00100 so the equivalent and perhaps slightly more understandable would be.
double tenPips = 0.00100, // or 10 * pips2dbl upperBid = MathCeil( Bid / tenPips) * tenPips, lowerBid = MathFloor(Bid / tenPips) * tenPips;
Thank you very much! I seem it works!
WHRoeder:
You want to round to the nearest 0.00100 so the equivalent and perhaps slightly more understandable would be.
You want to round to the nearest 0.00100 so the equivalent and perhaps slightly more understandable would be.
I also thank you
William Roeder:
You want to round to the nearest 0.00100 so the equivalent and perhaps slightly more understandable would be.
You want to round to the nearest 0.00100 so the equivalent and perhaps slightly more understandable would be.
double tenPips = 0.00100,; // or 10 * pips2dbl upperBid = MathCeil( Bid / tenPips) * tenPips,; lowerBid = MathFloor(Bid / tenPips) * tenPips;
Shouldnt it be like this?
codenameCookie: Shouldnt it be like this?
That won't compile. There's only one double, three variables.

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 all, I need to round Bid to the highest and lowest value, as in this example
Bid = 1.24231
I need to obtain 1.24300 (upper round) and 1.24200 (lower round).
I’m trying to use MathRound() and NormalizeDouble() but it doesn’t work.
Could you help me? Thanks!!!