Skip to content
All library documents

Displaying Profit and Loss Labels on Newly Closed Trades

Article MQL5 code base

Summary

This brief note describes a demonstration of labeling recently closed trades with their profit or loss. The example expert advisor places dummy trades so the labels can be seen in a strategy tester. It offers two rendering approaches: drawing with a Canvas library, or using standard text and rectangle objects. The stated purpose is visual display and implementation comparison, rather than generating trade signals or evaluating a trading method.

The labels apply only to deals closed after the demonstration begins; existing trade history is not covered. The page does not include source code, screenshots, an explanation of how profit values are calculated, or details about handling fees, partial closes, and different instruments. It therefore provides a narrow concept for presenting closed-trade outcomes, but not enough evidence to assess correctness or usability in a production trading interface. The page's surrounding promotional material is unrelated to the implementation topic.

Key ideas

  • The demonstration displays profit and loss labels for recently closed deals.
  • It uses dummy trades so the display can be observed in a strategy tester.
  • Labels are drawn either with a Canvas library or with standard text and rectangle objects.
  • Only deals closed after the demonstration starts receive labels.
  • The note omits source code and details about calculating or validating displayed profit and loss.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.