@blac34 You can do it this way:

But according to your uploaded image, many trades were closed days ago. In your example, 3 trades were closed on April the 7th. Then in the text below you specify that the current open trade on profit (+12) should be closed because when combined with all the other open trades, profit is above $5. I don0t see the logic behind it.
@Mrezab You can also store the value of both MA on different variables and do the math.
@hamoye This is the second thread you created for the exact same question. Please don't duplicate threads.
Do you mean you installed it on your MT5 platform or on your fxDreema project befreo running on your MT5 platform?
¿Probaste a usar Firefox en lugar de Chrome?
But that is s static image of the trades right now. News trades are supposed to be open over and over. Are they supposed to be closed in a shorter period than the oldes ones?
@DragonZueloTrends Al final renuncié a conseguir ese dato. Tuve que encontrar otra información equivalente que no estaba relacionada con el DD.
This is the second time you are requesting the exact same feature. Please don't duplicate threads.
You can dop that with variables (different for chart and all charts). However, the problem is the period to consider. If you need to check for all closed trades since the account was created, definitely a custom indicator will be far more efficient.
Ok. But is tha variable supposed to show the cumulative profit of all previous batches or the last batch only?
For how long you need to search for that higher ligh? One hour? One day?
When is that variable supposed to be reset? At the end of the day? As soon as a new batch of trades is open?
Many brokers hinder the option of programming pending orders, especially in moments of high volatility. I would recommend you trying on different brokers.
That is virtually impossible to do unless you are using a common TP level for all your trades. Every time a new tick is arriving to the MT4, all profits are recalculated. That means each open trade will add at least one more pip the the current single profit. For example, 4 open trades means a new tick will add 4 more pips to the global profit.
Could you please be more specific? What is the exact problem?
@alok You need to add a pink 'once per trade' block before block 5. Otherwise you'll get multiple partial close per tick.