OrderOpenPrice( ) question

 

Does anyone know why, OrderOpenPrice( ), returns 4th decimal number instead of 5th?

Thanks!

 
Yellowbeard:

Does anyone know why, OrderOpenPrice( ), returns 4th decimal number instead of 5th?

Thanks!

Print(DoubleToStr(OrderOpenPrice(),5));


CB

 
cloudbreaker wrote >>

Print(DoubleToStr(OrderOpenPrice(),5));

CB

But I need this as a number not a string.

 

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

 
cloudbreaker wrote >>

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

Reason: