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
I hope to bring this up again because some strategy I use need to close individual order instead of the whole position.
Can MQ give some info???
You cannot close an Order, you can delete a Pending Order. You can place an Order and once it is executed it becomes a deal, that deal may create, add to or subtract from a position.
If you are using and discussing MT5/mql5 you must use the correct terminology if you want to communicate effectively: Orders, Positions and Deals in MetaTrader 5
so sorry, its deal...
can close individual deals???
Create a new order, opposite direction of your deal, with same volume. (Please don't double posts).
but I just want to close the order in profit
any workaround??
but I just want to close the order in profit
any workaround??
so sorry, its deal...
can close individual deals???
I think I have a solution to it. If you are coding an expert advisor. Use an array to store the deal details as it is made one by one and close each deal as and when required using the same array information.
Instead of depending on the terminal to provide you the deal details, you can create a similar array table by yourself and track the price movements.
I hope this will be helpfull!
Yes, of course. The average entry price may be changed only with entry, not exit.
I think average price will change with both entry and exit.
1 lots @ 2
1 lots @ 3
1 lots @ 4
average price = (2+3+4)/3 = 3
close 1 lot.
considering if @ 2 FIFO based closed the average = (3+4)/2=3.5
considering if @ 3 LIFO based closed the average = (2+4)/2 = 3
considering if @ 4 is closed the average = (2+3)/2 = 2.5
Thats a lot of difference, a difference if ending in a profit/loss. I guess we all want to be in profit, so accuracy of calculation is very important.
I think I have a solution to it. If you are coding an expert advisor. Use an array to store the deal details as it is made one by one and close each deal as and when required using the same array information.
Instead of depending on the terminal to provide you the deal details, you can create a similar array table by yourself and track the price movements.
I hope this will be helpfull!
but if the software got restarted, all the data will be gone.
secondly the average price in the position will used instead of the deal open price.
I think I have a solution to it. If you are coding an expert advisor. Use an array to store the deal details as it is made one by one and close each deal as and when required using the same array information.
Instead of depending on the terminal to provide you the deal details, you can create a similar array table by yourself and track the price movements.
I hope this will be helpfull!
I think average price will change with both entry and exit.
1 lots @ 2
1 lots @ 3
1 lots @ 4
average price = (2+3+4)/3 = 3
close 1 lot.
considering if @ 2 FIFO based closed the average = (3+4)/2=3.5
considering if @ 3 LIFO based closed the average = (2+4)/2 = 3
considering if @ 4 is closed the average = (2+3)/2 = 2.5
Thats a lot of difference, a difference if ending in a profit/loss. I guess we all want to be in profit, so accuracy of calculation is very important.