calculate diference value from openprice and market to add a stoploss when the profit is positive

 

Hello,
for the currency that have 5 digits
i use this:

dif =  (OrderOpenPrice() - vbid) / 100;

and i can see the diference between openprice and market to calculate the stoploss,

for example: stoploss = vbid - dif;
this work fine for 5 digits the stoploss is ok because the digits number are the same.

The problem is for the 3 digits currency
that sometimes i receive from the market: 83.111 and other time 83.1100012111 etc
i have tried to use NormalizeDouble ( market , vdigits ) but the diference from the
openprice and market is not ok to calculate the stoploss because the value digits is always changing.
How can i fix the problem of the 3 digits currency for calculate the diference and then calculate
the stoploss ?

thank you for your help.

Reason: