There is a BUG in NormalizeVolumeInUnits()

Created at 15 Mar 2021, 13:32
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
bienve.pf's avatar

bienve.pf

Joined 19.09.2018

There is a BUG in NormalizeVolumeInUnits()
15 Mar 2021, 13:32


There is a BUG in NormalizeVolumeInUnits:
This is only in cTrader 4.0

 

var vol = Symbol.NormalizeVolumeInUnits(20, RoundingMode.Down);

//RESULT
//vol = 19.900000000000002
​​​​​​​//the asset is GOLD. 


 


@bienve.pf
Replies

amusleh
15 Mar 2021, 14:30

I tried in Skilling cTrader, it returns 19.9 for down and 20 for up and nearest rounding, I will verify this with the team if this is the expected behavior or not.

In Spotware beta it returns 20 for all rounding modes, and if there was a bug it might be already fixed, I will report this and I will update you.

Thanks for reporting this issue.


@amusleh

amusleh
16 Mar 2021, 14:08

The team were able to reproduce this issue and it will be fixed in future releases, thanks.


@amusleh

bienve.pf
17 Mar 2021, 12:23

RE:

amusleh said:

The team were able to reproduce this issue and it will be fixed in future releases, thanks.

Perfect. Thanks for your response.


@bienve.pf