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 ?
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
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.