JPY price won't normalise?

Back to topics list To post a new topic, please log in or register
avatar
2
scarte644 2016.06.24 09:07
 

Hey everyone,

I have a strange problem. An EA I coded tests fine on everything but CHF and JPY pairs where sometimes erratic prices form and won't normalise.

For instance, the ask price from yesterday for NZDJPY at 22:00:03.357 is 77.11499999999999. I then normalise that as part of the process with normalisedouble to 3 digits, and the result is... 77.11499999999999.

The same thing happened on USDCHF and some others, all JPY or CHF pairs though.

Pulling an odd ask figure is fine, but why won't the normalise function work on it to get it to a usable figure?

Many thanks for any insights.

Steve

avatar
2017
gooly 2016.06.24 10:26 #
 
The reason is the nature of the doubles (Wiki..). Use DoubleToString() or PrintFormate() to get an "pleasant look".
avatar
Moderator
3422
GumRai 2016.06.24 10:26 #
 

The price IS normalized.

If you need to display or Print use DoubleToStr()

avatar
2
scarte644 2016.06.24 13:34 #
 
Ah lovely, thank you both :)
Back to topics list  

To add comments, please log in or register