//+------------------------------------------------------------------+ //| Catch22Validate.mq5 | //| MMQ — Muhammad Minhas Qamar | //| www.mql5.com/en/articles/23488 | //+------------------------------------------------------------------+ #property copyright "MMQ — Muhammad Minhas Qamar" #property link "https://www.mql5.com/en/articles/23488" #property version "1.00" #property strict #property script_show_inputs #include //--- pick what to feed the engine: a deterministic fixture (for //--- cross-checking against pycatch22) or live symbol returns. enum ENUM_C22_SOURCE { SRC_FIXTURE, // reproducible sine+noise vector defined below SRC_RETURNS // log returns of the current symbol/timeframe }; input ENUM_C22_SOURCE InpSource = SRC_FIXTURE; // input data source input int InpLength = 200; // window length input int InpSeed = 12345; // RNG seed for the fixture //+------------------------------------------------------------------+ //| Deterministic fixture: x[i] = sin(2*pi*i/20) + 0.5*sin(i/7) | //| plus a seeded uniform noise term. Fully reproducible so the | //| printed feature vector can be compared to a pycatch22 run on the | //| identical vector (which the script also dumps to a CSV). | //+------------------------------------------------------------------+ void BuildFixture(double &x[],int n,int seed) { ArrayResize(x,n); MathSrand(seed); for(int i=0;i