Download MetaTrader 5

ordercloseby() function

To add comments, please log in or register
Byakatonda Denis
50
Byakatonda Denis  

can some one explain to me what exactly the Ordercloseby() function does, am having hard time to code it into my robot.

Does it close and order and then opens an opposite one, or...it just closes an order depending on the opposite one.

what exactly do the parameters of this function mean???

OrderCloseBy(ticket, opposite, Color)

Especially "ticket"and "opposite".

thanks..

whroeder1
17093
whroeder1  
  1. It "just closes an order depending on the opposite one" thus saving one spread vs. close and then open an opposite one.
  2. Not permitted on some brokers.
  3. Hedging not permitted for US traders.
nicholishen
1538
nicholishen  
whroeder1:
  1. It "just closes an order depending on the opposite one" thus saving one spread vs. close and then open an opposite one.
  2. Not permitted on some brokers.
  3. Hedging not permitted for US traders.
How does it save spread?
whroeder1
17093
whroeder1  
The book says (between Figures 95 and 96):
However, if we use in this situation the function OrderCloseBy() intended for opposite closing of orders, the economic output will be better (as compared to the preceding alternative) by the amount proportional to the cost of one order's spread
To add comments, please log in or register