OrderClose() issue mql4 - page 2

 
Vladislav Boyko #:

Simple example

Thank you again

 
Daniel Cioca #:
If use OrderClosePrice() you can forget about the direction of the closing trade 

Thank You for help

In my case its necessary to close orders according  to their types

 
William Roeder #:
  1. Each server call takes time. When it finishes, your predefined variables will be wrong. RefreshRates after each call.
  2. Or, stop using Bid/Ask and use OrderClosePrice() to be direction independent.
  3. Prices you get from the terminal (Bid/Ask) are already normalized.

Thank you dear William

I considered tips 1 and 3 for my case and it work now.

 
William Roeder #:

This post is not about history. It is about closing using Bid/Ask vs. OCP.

Yes exactly

Reason: