MQL CODE TO GIVE THE COMMAND TO INCREASE THE TAKE PROFIT OF X PIPS ONGI WHEN THERE ARE OTHER OPEN OPERATIONS
-
I HAVE ALREADY USED THE BLOCK LOOKING FOR THE AVERAGE PROFIT BUT UNFORTUNATELY WITHOUT TAKE PROFIT PRESET WHEN I DO THE BTS MANY TIMES IT DOESN'T CLOSE THE OPERATIONS SO I HAVE THE INTENTION TO SET UP AN INITIAL TAKEPROFIT AND TO CHANGE IT EVERY TIME I OPEN OTHER POSITIONS ON A MORE POSITIONS TOTAL PIPS FOR EVERYONE FOR EXAMPLE, BUY EURUSD, TAKE PROFIT 10 PIPS. GBPUSD IS ALSO PART AND THE TP MUST AUTOMATICALLY CHANGE SO THAT THE TOTAL PROFIT BETWEEN EURUSD AND GBPUSD IS 10 PIPS
-
DEMANDING PROJECT!!
you would have to work with group of trades and then you can calculate tp sl and everything for a whole group of trade
-
YOU HAVE AN EXAMPLE TO SHOW ME .. WHY I CAN'T UNDERSTAND
-
@luanainteglia Can you please share your current project?
-
https://fxdreema.com/shared/68qXHNbsc THIS IS MY LINK
-
@luanainteglia Ok. I see you are using different group numbers. That is good. However, I see you are using group 1 for more than 1 symbol (EURUSD and AUDUSD). Will all groups be modified exactly in the same way when the TP is supposed to be modified?
-
@l-andorrà yes, do not pay attention to the groups I have to modify it I will put everything in such a way that the EA does what I say that is that it uses the average take profit function but setting the take profit pips position by position that changes every time it opens a new position, I don't know if I have explained myself well, suppose there were only two pairs, EU and GU, I want a take profit of 10 points, if it starts EU only, it closes at 10 pips, if GU starts then the tp EU and GU will be such that the sum of the two TaKE PROFIT is equal to 10 pips
-
@luanainteglia No problem. Once you adjusted the groups, let us know.
-
I HAVE PROBABLY EXPLAINED MYSELF BADLY BECAUSE OF THE TRANSLATION, I WANTED TO SAY THAT INDEPENDENTLY FROM THE RENUMERATION OF THE GROUPS, I WOULD LIKE TO KNOW HOW TO OBTAIN THE AVERAGE OF TAKE PROFITS WITH A SINGLE RESULT FOR ALL PAIRS
-
@luanainteglia Do you mean the average amount of pips in profit/loss from open trades right now? Or the average price used as TP for all open trades right now?
-
@l-andorrà then I give a more elementary example. I don't care about the stop loss. only interested in the tp, I want a tp of x pips regardless of the pairs open, if I have one open I want 10 pips, if I have two open I want the sum to make 10 pips, doing so with all the pairs, but the take pips profit must be calculated and entered automatically, the broker must read it
-
@luanainteglia Then you need a variable counting all open trades right now and then closing all open trades when those global 10 pups are reached. You should use this structure:

-
@l-andorrà I have already used this block but it is not good because it does not do a calculation on the pips of tp but on the equity and often when there is a lot of volatility it reaches 10 pips and does not close the operations for this I would like to put an algorithm that calculates the take profit
-
@luanainteglia That problem of volatility is inevitable. That will happen with any structure you create.