# 4 & 5 points calculation issue

165

Hello,

in the above image

Exponential Moving average = 1.13688       > (EMA)

HeikenAshi Close = 1.13687                       > (HAClose)

in my EA I have program condition if HAClose is less than EMA than do some work. I want to do this work on 4 digit basis like:

EMA = 1.1368

HAClose = 1.1368

now in this case HAClose in not less than EMA now HAClose == EMA.

If I NormalizeDouble() on 4 digits it round of 4th digit in my case I don't want to be rounded. I need to trim 5th digit or don't want to consider what ever it is.

I want to calculate my calculations on 4 digits. HOW TO ACHIEVE THIS?

18563

kumaillakhani:

If I NormalizeDouble() on 4 digits it round of 4th digit in my case I don't want to be rounded. I need to trim 5th digit or don't want to consider what ever it is.

I want to calculate my calculations on 4 digits. HOW TO ACHIEVE THIS?

how do you want the value to be?
DoubleToString()

DoubleToString - Conversion Functions - MQL4 Reference
• docs.mql4.com
value is in the range between 0 and 16, a string presentation of a number with the specified number of digits after the point will be obtained. If the value is in the range between -1 and -16, a string representation of...
2282

If I NormalizeDouble() on 4 digits it round of 4th digit in my case I don't want to be rounded. I need to trim 5th digit or don't want to consider what ever it is.

165

how do you want the value to be?
DoubleToString()

I need double because I need to do calculation on it.

3435

kumaillakhani:

If I NormalizeDouble() on 4 digits it round of 4th digit in my case I don't want to be rounded. I need to trim 5th digit or don't want to consider what ever it is.

I want to calculate my calculations on 4 digits. HOW TO ACHIEVE THIS?

Did you tried to convert to string, rip off the 5th digit and convert it again to double?