| //+------------------------------------------------------------------+
|
| //| TkzSelfTest.mq5 |
|
| //| Runs the TKZ codec self-test inside MetaTrader 5. |
|
| //+------------------------------------------------------------------+
|
| #property copyright "TKZ tick compression"
|
| #property version "1.1"
|
| #property description "Self-test of the TKZ tick codec: synthetic edge cases, real ticks of the chart symbol, archive files."
|
| #property script_show_inputs
|
|
|
| #include "../lib/TkzSelfTest.mqh"
|
|
|
| input int InpHistoryTicks=2000000; // Recent ticks of the chart symbol to test (0 = skip)
|
|
|
| //+------------------------------------------------------------------+
|
| void OnStart()
|
| {
|
| CTkzSelfTest test;
|
| test.RunGolden();
|
| 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());
|
| }
|
| //+------------------------------------------------------------------+
|