Expert Advisors • Indicators • Scripts • Libraries

MQL.RobotFX.org is the biggest collection of MetaTrader expert advisors (MT5 & MT4), indicators, scripts and libraries that can be used to improve trading results, minimize risks or simply automate trading tasks

MetaTrader 5 Expert Advisor | Profit labels for closed trades (deals)

A simple demonstration to show how it's possible to code profit and loss labels for the most recently closed deals. 

This EA will place dummy trades, so you can see how it looks in the strategy tester. The labels will only form on deals from now onwards (not on trade history).

I coded a solution using the Canvas library, and also the standard library. There are two inputs which can give you the option between using Canvas vs. using text and rectangle objects from the standard library. Feel free to improve upon the code if you think there's yet again a better solution.

Using canvas:

MetaTrader Experts, Indicators, Scripts and Libraries

Using standard objects:

MetaTrader Experts, Indicators, Scripts and Libraries

54352