Use OrdersClose(ticket, part_of_Volume,...), for example
for (int i=OrdersTotal()-1;i>=0;i--) { if (OrderSelect(i,MODE_TRADES)) { if (OrderType==OP_BUY) { double volume=NormslizeDouble(OrderLots()/2.0,1); int ticket=OrderTicket(); bool res=OrderClose(ticket,volume,Bid,3,Red); if (res) Print("Order #",ticket," was partially closed"); else ("Partially closing of order #",ticket,"is failed!"); } } }
I see,
thank you Rosh
thank you Rosh
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
For example, we enters the market with 2 lots, after certain price we want to close it partially (1 lot), and left the rest 1 lot in the market. I know we can do it manually, but is it possible to do that using an EA?
Thanks