SOLVED: EA code to avoid placing duplicate pending orders - Thank you, ronaldosim!

 
I have written EA code to cycle through all pending orders and compare the price for each pending order to a "new" order price to avoid placing duplicate orders, but it does not always detect all of the duplicate prices. It works sometimes on some prices, on some buy stop or sell stop types, and on some symbols, but not consistently. Can anyone give me code that avoids placing duplicate (same price) pending orders?
 
AssistPlease wrote >>
I have written EA code to cycle through all pending orders and compare the price for each pending order to a "new" order price to avoid placing duplicate orders, but it does not always detect all of the duplicate prices. It works sometimes on some prices, on some buy stop or sell stop types, and on some symbols, but not consistently. Can anyone give me code that avoids placing duplicate (same price) pending orders?

try using normalizedouble since u are likely to be comparing two double variables

Reason: