2026-09-09 01:19:31 +03:00 | | | //+------------------------------------------------------------------+
|
2026-09-10 16:43:28 +03:00 | | | //| LatencyReport.mq5 |
|
2026-09-16 15:37:55 +03:00 | | | //| Copyright 2026, MetaQuotes Ltd. |
|
2026-09-10 16:43:28 +03:00 | | | //| www.mql5.com |
|
2026-09-09 01:19:31 +03:00 | | | //+------------------------------------------------------------------+
|
2026-09-16 15:37:55 +03:00 | | | #property copyright "Copyright 2026, MetaQuotes Ltd."
|
2026-09-10 16:43:28 +03:00 | | | #property link "https://www.mql5.com"
|
| | | #property version "1.00"
|
| | | #property description "Повторный расчёт отчёта из архивных CSV"
|
| | | #property description "по ТЗ §8/§10. Читает только исходные файлы."
|
| | | #property description "Пересчитывает интервалы, summary и гистограммы."
|
| | | #property description "Не обращается к текущему счёту."
|
2026-09-16 15:37:55 +03:00 | | | #property script_show_inputs
|
2026-09-09 01:19:31 +03:00 | | |
|
| | | #include "..\Include\RequestLatencyLab\Models.mqh"
|
| | | #include "..\Include\RequestLatencyLab\CsvStorage.mqh"
|
| | | #include "..\Include\RequestLatencyLab\Statistics.mqh"
|
| | | #include "..\Include\RequestLatencyLab\ReportBuilder.mqh"
|
| | |
|
2026-09-12 22:14:24 +03:00 | | | input string InpDatasetDir = "RequestLatencyLab\\RLL-C1"; // каталог набора в песочнице
|
| | | input string InpOutputDir = "RequestLatencyLab\\report-rebuilt";
|
2026-09-10 22:54:26 +03:00 | | | //--- R4-B6 (E4): report-only из пяти завершённых E1 ASYNC datasets
|
2026-09-16 15:37:55 +03:00 | | | input bool InpE4Mode = true; // E4: multi-dataset reuse
|
2026-09-12 22:14:24 +03:00 | | | input string InpE4Dataset2 = "RequestLatencyLab\\RLL-C1"; // E1 серия 2
|
| | | input string InpE4Dataset3 = "RequestLatencyLab\\RLL-C1"; // E1 серия 3
|
| | | input string InpE4Dataset4 = "RequestLatencyLab\\RLL-C1"; // E1 серия 4
|
| | | input string InpE4Dataset5 = "RequestLatencyLab\\RLL-C1"; // E1 серия 5
|
| | | input int InpE4ExpectedMainPerSeries = 100; // R5-B7: MAIN-квота серии
|
| | | //+------------------------------------------------------------------+
|
| | | //| Формирование отчёта о замерах |
|
2026-09-09 01:19:31 +03:00 | | | //+------------------------------------------------------------------+
|
2026-09-12 22:14:24 +03:00 | | | void OnStart(void)
|
2026-09-09 01:19:31 +03:00 | | | {
|
2026-09-10 16:43:28 +03:00 | | | LabError err;
|
2026-09-12 22:14:24 +03:00 | | | const string samples_path = InpDatasetDir + "\\samples.csv";
|
2026-09-10 16:43:28 +03:00 | | | string content;
|
2026-09-12 22:14:24 +03:00 | | | if(!CCsv::LoadUtf8(samples_path, content, err))
|
2026-09-09 01:19:31 +03:00 | | | {
|
2026-09-12 22:14:24 +03:00 | | | Print("LatencyReport: входной файл не найден: " + err.message);
|
2026-09-09 01:19:31 +03:00 | | | return;
|
| | | }
|
2026-09-10 22:54:26 +03:00 | | | if(InpE4Mode)
|
| | | {
|
| | | //--- R4-B6: E4 — анализ пяти E1 ASYNC серий без новых samples
|
| | | string dirs[5];
|
2026-09-12 22:14:24 +03:00 | | | dirs[0] = InpDatasetDir;
|
| | | dirs[1] = InpE4Dataset2;
|
| | | dirs[2] = InpE4Dataset3;
|
| | | dirs[3] = InpE4Dataset4;
|
| | | dirs[4] = InpE4Dataset5;
|
| | | if(CReportBuilder::RebuildE4(dirs, 5, "E4-POOLED", InpOutputDir + "\\", err,
|
| | | InpE4ExpectedMainPerSeries))
|
| | | Print("LatencyReport: E4 reuse-анализ завершён, отчёт в Files\\" + InpOutputDir);
|
2026-09-10 22:54:26 +03:00 | | | else
|
2026-09-12 22:14:24 +03:00 | | | Print("LatencyReport: E4 FAILED: " + err.message);
|
2026-09-10 22:54:26 +03:00 | | | return;
|
| | | }
|
2026-09-12 22:14:24 +03:00 | | | //--- полный пересчёт из исходных CSV
|
| | | if(CReportBuilder::RebuildReport(samples_path, InpOutputDir + "\\", err))
|
| | | Print("LatencyReport: пересчёт завершён, отчёт в Files\\" + InpOutputDir);
|
2026-09-09 01:19:31 +03:00 | | | else
|
2026-09-12 22:14:24 +03:00 | | | Print("LatencyReport: ПЕРЕСЧЁТ НЕ УДАЛСЯ: " + err.message);
|
| | | }
|
| | | //+------------------------------------------------------------------+
|