Are You Experienced?

 

Could someone experienced in using the function, OrderCloseBy(), please explain to me how it works exactly?

I've already done a search on this forum and on metaquotes.net for detailed information, but with no luck.

bool OrderCloseBy(int ticket, int opposite, color Color=CLR_NONE)

The obvious scenario is when the order that "ticket" refers to and the order that "opposite" refers to are both the same size - they both cancel eachother out completely.

But what happens when the sizes of the 2 orders are different?

1. An error code is generated and nothing is closed?

Or

2. The smaller sized order is closed (its ticket# is removed from the system) and the larger sized order (minus the size of the smaller order) stays open (its ticket# remains in the system)?

Or

3. Something else?

 
BC Brett:
Could someone experienced in using the function, OrderCloseBy(), please explain to me how it works exactly?

I've already done a search on this forum and on metaquotes.net for detailed information, but with no luck.

bool OrderCloseBy(int ticket, int opposite, color Color=CLR_NONE)

The obvious scenario is when the order that "ticket" refers to and the order that "opposite" refers to are both the same size - they both cancel eachother out completely.

But what happens when the sizes of the 2 orders are different?

1. An error code is generated and nothing is closed?

Or

2. The smaller sized order is closed (its ticket# is removed from the system) and the larger sized order (minus the size of the smaller order) stays open (its ticket# remains in the system)?

Or

3. Something else?

IMHO the answer is number 2.

Reason: