modify+(PipsToProtect*Point) is not normalized double. In common case you cannot compare 2 doubles for equality even if your doubles are normalized. See our function CompareDoubles in the stdlib.mq4 library sample
Welcome to mql4.com. Problem with comparison of 2 doubles was discussed many times
"MQL4: A Problem with Bid =="
"MQL4: int x = double y ?"
Welcome to mql4.com. Problem with comparison of 2 doubles was discussed many times
"MQL4: A Problem with Bid =="
"MQL4: int x = double y ?"
Thanks for the advice and sorry for the duplicate post
madmarkym
madmarkym
Hi
I am trying to get my head around the double problems and have tried to do a bit of recoding would this alternative code work, I have tried it but it still does not seem to work, can you see were I have gone wrong
I am trying to get my head around the double problems and have tried to do a bit of recoding would this alternative code work, I have tried it but it still does not seem to work, can you see were I have gone wrong
OrderSelect(tickarray[2],SELECT_BY_TICKET,MODE_TRADES); modify = OrderOpenPrice(); modify1 = OrderTakeProfit(); OrderSelect(tickarray[1],SELECT_BY_TICKET,MODE_TRADES); modify2 = OrderTakeProfit(); if (NormalizeDouble(((modify+(PipsToProtect*Point)) - modify1),4) == 0 && NormalizeDouble(((modify+(PipsToProtect*Point))- modify2),4)==0){// process order}
Many Thanks for your time
madmarkym

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I wonder if somebody can advise me, I know there are issues regarding comparing double numbers, and I was lead to believe that using Normalizedouble was the solution but my compare I still not working correctly.
Here is my compare code
Do I need to do two compares one for 4 decimal places and one for three decimal places?
Any Help is most appreciated
Thanks
madmarkym