Profit By Deal-Entry-In Per Hour Report for MT5 (unlike deal-entry-out in the native Tester Report)

Profit By Deal-Entry-In Per Hour Report for MT5 (unlike deal-entry-out in the native Tester Report)

12 August 2026, 16:38
Ryan L Johnson
0
31

As the MT5 Tester does not natively support reporting hourly profit and loss by deal-entry-in (only deal-entry-out), I created this MQL5 Service to to generate custom backtest reports limited to, and based on, deal-entry-in times.

For the sake of consistency of file types, the generated reports are in .xlsx (Windows Excel) format. Unlike in the native Tester Report, the long and short trades executed within each hour are netted out in the bar graph resulting in one bar instead of two for each hour.

An MQL5 Service runs independently of any chart. Save ProfitByHourReportService.mq5 to your MQL5==>Services folder, and compile it. Upon running the Service and a backtest being automatically detected, a ProfitByHour folder will be created in your MQL5==>Files. That is where the generated reports are saved.

Allow DLL imports must be enabled.

Process tests finished before start must be set to true if you want to analyze preexisting backtests. Set it to false to analyze only future backtests.

See the in-code comments regarding commission and swap data.

If you don't have Excel, free OpenOffice handles .xlsx files quite nicely.

I created this Service because, frankly, setting a trade entry time filter based on a trade exit time report makes about as much sense as a football bat.