I want my EA to open multiple deals. When price goes against me, I average in.
So when price went in my favour, can I select the individual deal in profit to close?
but can it be done?
closing deal instead of the position?
deal is a consequence of order. you cannot close a deal.
you have to give another order, which will result in another deal (if the order is correct).
check the documentation :)
No can't do https://www.mql5.com/en/articles/384#trading
Find the broker who can do - like hedging https://www.mql5.com/en/forum/8372/page2#comment_345054
I agree, what matters is the average price...
By the way, if you want, you can also close the position a little by little, by lot size, if it goes in your favor. You can close each deal by the exact amount (lot size) used in the position you opened.
as I guess so.
Another quick question.
If I open deals at price $3.00 - 1 lot, $2.00 - 1 lot, $1.00 - 1 lot
the average price is $2.00 - 3 lots. So if i close 2 lots at any price, is my average entry price still at $2.00?
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