Thread: Ask!
View Single Post
  #1446 (permalink)  
Old 03-02-2009, 05:07 PM
Lou G Lou G is offline
Junior Member
 
Join Date: Jun 2006
Posts: 22
Lou G is on a distinguished road
MT4 floating point errors

Is it possible to write mql4 code that does floating point arithmetic correctly?

I am a retired programmer with over 40 years of experience. I have thus far been unsuccessful in making an indicator I have written do correct calculations, in spit of using CompareDoubles and NormalizeDouble in every instance that they are necessary.

I've written a Python script (using the decimal library) to duplicate the work of my indicator and the errors of mql4 are clear to see when I compare the output of the two. There are not many discrepancies but there are some and this should not happen.

TIA
Reply With Quote