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

Asked by Radhesh Joshi · SOLVED
1 reply 496 views Jump to solution Reply
Radhesh Joshi Original Post
Strategy Builder

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.

Posted Jul 27
Reply

    1 Reply

    Tech Support AlgoDelta
    Tech Support AlgoDelta Automation Expert ·

    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.

    Verified Solution
    • 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. – Radhesh Joshi Jul 28
    Markdown supported · ```json for code blocks · paste or drop screenshots

    Be specific and kind. Never share API keys, passwords or personal account details.

    Welcome to the community

    Log in or create your account in under a minute.

    1. 1Mobile
    2. 2E-mail
    3. 3Password
    +91

    Have a password?

    By continuing you agree to the community guidelines. We’ll send a one-time code by SMS.