2026-11-06 16:16:49 -08:00 | | | //+------------------------------------------------------------------+
|
| | | //| TkzSelfTest.mq5 |
|
| | | //| Runs the TKZ codec self-test inside MetaTrader 5. |
|
| | | //+------------------------------------------------------------------+
|
| | | #property copyright "TKZ tick compression"
|
2026-11-06 20:31:08 -08:00 | | | #property version "1.1"
|
2026-11-06 16:16:49 -08:00 | | | #property description "Self-test of the TKZ tick codec: synthetic edge cases, real ticks of the chart symbol, archive files."
|
| | | #property script_show_inputs
|
| | |
|
2026-11-06 20:26:15 -08:00 | | | #include "../lib/TkzSelfTest.mqh"
|
2026-11-06 16:16:49 -08:00 | | |
|
| | | input int InpHistoryTicks=2000000; // Recent ticks of the chart symbol to test (0 = skip)
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | void OnStart()
|
| | | {
|
| | | CTkzSelfTest test;
|
2026-11-06 16:21:50 -08:00 | | | test.RunGolden();
|
2026-11-06 16:16:49 -08:00 | | | test.RunSynthetic();
|
| | | if(InpHistoryTicks>0)
|
| | | {
|
| | | MqlTick ticks[];
|
| | | ResetLastError();
|
| | | int n=CopyTicks(_Symbol,ticks,COPY_TICKS_ALL,0,(uint)InpHistoryTicks);
|
| | | if(n>0)
|
| | | test.RunTicks(ticks,n,_Symbol+" history");
|
| | | else
|
| | | PrintFormat("TKZ self-test: no tick history for %s (error %d), skipped",_Symbol,GetLastError());
|
| | | }
|
| | | test.RunArchive();
|
| | | PrintFormat("TKZ self-test finished: %d passed, %d failed",test.Passed(),test.Failed());
|
| | | }
|
| | | //+------------------------------------------------------------------+
|