Does anyone know why, OrderOpenPrice( ), returns 4th decimal number instead of 5th?
Thanks!
Print(DoubleToStr(OrderOpenPrice(),5));
CB
If you wanna use OrderOpenPrice( ) for calculations and your broker has 5 digits, don't worry, it will be 5 digits.
Was just trying to point out to you that it may in fact carry 5 digits of precision, but if you are printing it out to investigate without using the DoubleToStr() function, you may be fooling yourself into thinking its only 4 digits of precision, if for example, the value is something like 1.43420.
CB
Was just trying to point out to you that it may in fact carry 5 digits of precision, but if you are printing it out to investigate without using the DoubleToStr() function, you may be fooling yourself into thinking its only 4 digits of precision, if for example, the value is something like 1.43420.
CB
I appreciate your input CB! I noticed that when one of my trades closed, at 1.41687, OrderOpenPrice(), actually returned: 1.4169. A small difference,true! But enough to throw off calculations, especially when you have routines, built into your EA, which utilize the value of OrderOpenPrice() to determine the point for closing trades and/or resetting other values to allow continued trading if a trade closes by SL or TP. OrderClosePrice() does the same.
Thanks!
Not for me it doesn't. Can you post your code?
CB

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Does anyone know why, OrderOpenPrice( ), returns 4th decimal number instead of 5th?
Thanks!