Partial close
-
@fxDreema In MT5 can i partial close without making open a new trade? when i use block "partial close" in fxdreema ?
-
Hi Fxdreema,
Could you add the partial close without making a new trade? I say this because you are making the double of trades and paying the double of comissions with this "close(partially)" and this is a lot. I have found that it's possible doing this with OrderCloseBy (https://docs.mql4.com/trading/ordercloseby). I found this EA that implements it http://forex-strategies-revealed.com/fi ... lClose.mq4
Okey, thanks.
-
Closes an opened order** by another opposite opened order**.
This is some way of combining 2 orders into 1. You can do this manually and you can combine few orders into 1. But in the EA only 2 can be turned to 1. I was thinking where can I use this functionality, but I don't know. In what situation you want to do that partial close?
-
A pending order that closes part of a trade. In this example, the ea functions more or less, but is so slowly and is doing the same that the close partially. But in the real chart I don't know if it opens a new trade or it close some lots.
This is useful for example when open a trade with SL and you want to take benefits at X pips (25% of total lots) and the rest for the trailing stop (75% of total lots).This ea is not useful, but can illustrate the example above: https://fxdreema.com/shared/vIXPNqJ5
-
In MT4 trades are closed by one function called OrderClose(). The same function is used to partially close a trade, because one of it's attributes is "lots". When a trade is closed partially, what happens is that new one is actually created. That new trade has new ticket number, but some of its parameters are the same as those in the original trade. So there is a way to detect that this new trade is a child, but otherwise you can't recognize it juts by looking at it. Sorry, I can't change that behaviour, this is how MT4 works.
The only other function that can close something is OrderCloseBy(), but again, what this function does is to combine 2 trades into 1. It accepts two different ticket numbers from two trades opposite to each other. This is not the same as having 1 trade and partially close it. OrderCloseBy() does not work for only 1 trade. And even if you have multiple trades, 2 of them must be specified.
-
Ah ok, so with OrderCloseBy is not possible to close partial with an opposite order respect of the trade. Well I'll continue thinking on other ways.
A few minutes ago I have founded a really good indicator http://www.forexfactory.com/attachment. ... 1417926766 it prints something like this http://prntscr.com/afdjy2 or this one http://www.forexfactory.com/attachment. ... 1417926185 that prints this http://prntscr.com/afdkbt, the last one is more visual and the other is more technical; both are good and but I prefer going more technical; also they could be used without an expert advisor, but that's isn't the objective so, when I upload to My Custom Indicator, both are empty on Input Parameters and Output Buffers, how can I solve it? I'm a bit lost.
Your support is grateful.
-
.ex4 files can't be uploaded, their content is encrypted and only MetaTrader understands it. But you can manually define inputs and buffers. Here is more
https://fxdreema.com/help/-/you%20shoul ... indicators
https://fxdreema.com/help/-/working%20w ... indicators -
@Nguyen-Nam-Oanh Unfortunately not. A new trade with a new ticket number is created automatically.
-
@l-andorrà do you have any way for partial close without making open a new trade for MT5 ?