Home Forums MT4/MT5 Connection How can I display live strategy information on the MT5 chart instead of checking the logs?

How can I display live strategy information on the MT5 chart instead of checking the logs?

  • Author
    Posts
    • I’m developing an Expert Advisor in MT5 and I currently use the Print() function to check values like Trend, Entry Price, Stop Loss, Target, Current Profit, ATR, EMA, RSI, and other strategy variables.

      The problem is that I have to keep opening the Experts or Journal tab to monitor everything, which becomes difficult while testing.

      Is there any way to display all this information directly on the MT5 chart so it updates live while the strategy is running? I also want it to look clean like a small dashboard on the chart.

    • Yes, definitely.

      Instead of printing values in the Experts log, you can display them directly on the MT5 chart using the built-in Comment() function.

      The Comment() function creates a live information panel in the top-left corner of the chart and automatically updates every time your EA executes.

      You can display almost any information, such as: Trend Direction, Current Position, Entry Price, Stop Loss, Target Price, Current Profit/Loss, etc…

      A simple example is shown below:

      Comment(
         "Trend          : ", trend, "\n",
         "Entry Price    : ", entryPrice, "\n",
         "Stop Loss      : ", stopLoss, "\n",
         "Target         : ", targetPrice, "\n",
         "Current Profit : ", currentProfit, "\n",
         "ATR            : ", atrValue, "\n",
         "EMA Fast       : ", emaFast, "\n",
         "EMA Slow       : ", emaSlow
      );

      Place this code near the end of your OnTick() function (or wherever your strategy updates its values).

      Every time a new tick arrives, the displayed information will refresh automatically, giving you a live dashboard of your strategy.

      This approach is much cleaner than continuously checking the Experts log and is commonly used while developing and debugging MT5 Expert Advisors.

    • Thanks for the help now I am able to display all the necessary things that before I have to see from the Experts.

      Really appreciate with the code example.

Viewing 2 reply threads
×

Start a Discussion

Get help from the AlgoDelta community.

×

Welcome Back!

Enter your email to sign in or create an account. No passwords needed.

⚠️

Delete This?

Are you sure you want to delete this? This action is permanent and cannot be undone.

Scroll to Top