Comment in MT5 trading history report - page 4

 
buleganteng #:

This is the HTML I use in the report...

I did the same and no changes. Here is one of the lines of the report after generation.

        <tr bgcolor="#F7F7F7" align="right">
            <td>2025.02.04 22:56:42.365</td>
            <td>54221900</td>
            <td>EURGBP</td>
            <td>buy</td>
            <td class="hidden" colspan="8">7;[0]</td>
            <td class="">0.3</td>
            <td class="">0.83163</td>
            <td class=""></td>
            <td class="">0.83179</td>
            <td class="">2025.02.04 23:05:58.574</td>
            <td class="">0.83180</td>
            <td class="">-0.60</td>
            <td class="">0.00</td>
            <td colspan="2">6.13</td>
        </tr>
 
fxsaber #:

I did the same and no changes. Here is one of the lines of the report after generation.

If you have <!--POSITION_COMMENT_CLASS--> in the HTML template then it needs to be replaced with <!--POSITION_CLASS-->

Can you attach complete your ReportHistory.html file?

 
buleganteng #:

Can you attach complete your ReportHistory.html file?

Attached.

Files:
 
buleganteng #:

If you have <!--POSITION_COMMENT_CLASS--> in the HTML template then it needs to be replaced with <!--POSITION_CLASS-->

Can you attach complete your ReportHistory.html file?

Good job Bro
 
fxsaber #:

Attached.

Try this file. I don't the exact reason, but when I tried your template file, the comments did not appear. There is probably a small error somewhere that was corrupting the output. So I just replaced the file with the HTML that works for me.


Worst case scenario. The comments are in the report - just hidden. So worst case scenario is save the HTML report, edit with an editor and remove the "hidden" from the HTML source code.
Files:
 
Elvis Tangalayuk #:
Good job Bro
When migrating from MT4 to MT5, I noticed the reports were not the same. Just like fxsaber, I need the comment information. But I couldn't find the solution. Then I realized the output is a template file. So I look at the template file and noticed the "comments" were hidden. Why they are hidden, I don't know. While it's true that sometimes the broker will change the comments, 99% of my comments retain the original comment even if [tp] or [sl] is added to the comment. Anyway, attached is my template file. Give it a try.
Files:
 
buleganteng #:
Anyway, attached is my template file. Give it a try.

This template works, thank you very much!

 
fxsaber #:

This template works, thank you very much!

Great to hear. There was a small error in the template. So it was easier just to replace your template file with my template file. But if you make changes or alterations to the template file and you get a corruption, then you know you have a small error somewhere in the code.
 
Mitsuru:
I want to analyse each EA trading from the trading history report in MT5. If a position closed by SL or TP, [sl xxx.xx] or [tp xxx.xx] is written in comment field in the report instead of original comment. I don't know which EA trades the position. Is there any way to keep original comment which EA write?

No — MT5 replaces the original comment with [sl ...] or [tp ...] when a trade closes by SL/TP. To track the EA, use the magic number ( ORDER_MAGIC ) — it stays intact and doesn't get overwritten. Assign a unique magic number per EA and analyze history with HistoryOrderGetInteger(..., ORDER_MAGIC) .